From 24461a6feae0974c096f013c5814f790f717b454 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Wed, 18 Dec 2019 11:05:04 +1100 Subject: [PATCH] Ignore faulty x-forwarded-proto. Fixes #89. --- lib/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app.js b/lib/app.js index f7cf763..b03baee 100644 --- a/lib/app.js +++ b/lib/app.js @@ -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) +