Skip to content

Commit

Permalink
Issue jakearchibald#48: Fix images not serving with the correct respo…
Browse files Browse the repository at this point in the history
…nse Headers
  • Loading branch information
Darren Seet committed Jan 17, 2018
1 parent 28d9ac3 commit f8203e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export default class Server {
this._app.get('/photos/:farm-:server-:id-:secret-:type.jpg', (req, res) => {
const flickrUrl = `http://farm${req.params.farm}.staticflickr.com/${req.params.server}/${req.params.id}_${req.params.secret}_${imgSizeToFlickrSuffix[req.params.type]}.jpg`;
const flickrRequest = http.request(flickrUrl, flickrRes => {
Object.keys(flickrRes.headers).forEach((header) => {
res.setHeader(header, flickrRes.headers[header]);
});
flickrRes.pipe(res);
});

Expand Down

0 comments on commit f8203e1

Please sign in to comment.