Skip to content

Commit

Permalink
Fix for no images
Browse files Browse the repository at this point in the history
  • Loading branch information
firedev committed Dec 1, 2020
1 parent 28d9ac3 commit 5e43617
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions server/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class Server {
server: this._appServer,
path: '/updates'
});

const staticOptions = {
maxAge: 0
};
Expand Down Expand Up @@ -101,7 +101,11 @@ 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]);
});
// flickrRes.pipe(res);
res.sendStatus(301)
});

flickrRequest.on('error', err => {
Expand Down Expand Up @@ -189,7 +193,7 @@ export default class Server {
_onWsConnection(socket) {
const requestUrl = url.parse(socket.upgradeReq.url, true);

if ('no-socket' in requestUrl.query) return;
if ('no-socket' in requestUrl.query) return;

this._sockets.push(socket);

Expand Down Expand Up @@ -254,4 +258,4 @@ export default class Server {
this._listen();
}
}
}
}

0 comments on commit 5e43617

Please sign in to comment.