Skip to content

Commit

Permalink
Fix static flickr images redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantazes, George committed Mar 7, 2023
1 parent fd4a7f3 commit 71cfa1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ 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 => {
flickrRes.pipe(res);
Object.keys(flickrRes.headers).forEach((header) => {
res.setHeader(header, flickrRes.headers[header]);
});
res.sendStatus(301)
});

flickrRequest.on('error', err => {
Expand Down

0 comments on commit 71cfa1c

Please sign in to comment.