From a6bd58506ccb310951aa4d1d660113da19337ace Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 18 Aug 2018 02:27:34 -0600 Subject: [PATCH] v2.3.13: proper case handling of Host header --- index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ec1ef46..07ee026 100644 --- a/index.js +++ b/index.js @@ -502,7 +502,7 @@ Greenlock.create = function (gl) { if (!host[0]) { realNext(); return; } // if so, remove non-allowed characters - var safehost = host[0].replace(SERVERNAME_G, ''); + var safehost = host[0].toLowerCase().replace(SERVERNAME_G, ''); // if there were unallowed characters, complain if (!gl.__sni_allow_dangerous_names && safehost.length !== host[0].length) { @@ -513,7 +513,7 @@ Greenlock.create = function (gl) { // make lowercase if (!gl.__sni_preserve_case) { - host[0] = host[0].toLowerCase(); + host[0] = safehost; req.headers.host = host.join(':'); } diff --git a/package.json b/package.json index 7e01d1c..2955773 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "greenlock", - "version": "2.3.12", + "version": "2.3.13", "description": "Let's Encrypt for node.js on npm", "main": "index.js", "files": [