Skip to content

Commit

Permalink
Ignore faulty x-forwarded-proto.
Browse files Browse the repository at this point in the history
Fixes mojodna#89.
  • Loading branch information
stevage committed Dec 18, 2019
1 parent ca87562 commit 24461a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/app.js
Expand Up @@ -256,7 +256,7 @@ module.exports = function(tilelive, options) {
return next(err);
}

var protocol = req.headers['x-forwarded-proto'] || req.protocol;
var protocol = req.headers['x-forwarded-proto'] && req.headers['x-forwarded-proto'].match(/^[a-z]+$/) || req.protocol;
var host = req.headers['x-forwarded-host'] || req.headers.host;
var uri = protocol + "://" + host +
(path.dirname(req.originalUrl) +
Expand Down

0 comments on commit 24461a6

Please sign in to comment.