1
0
鏡像自 https://github.com/therootcompany/greenlock.js.git synced 2024-11-16 17:29:00 +00:00

v2.3.13: proper case handling of Host header

This commit is contained in:
AJ ONeal 2018-08-18 02:27:34 -06:00
父節點 b7505cbccb
當前提交 a6bd58506c
共有 2 個檔案被更改,包括 3 行新增3 行删除

查看文件

@ -502,7 +502,7 @@ Greenlock.create = function (gl) {
if (!host[0]) { realNext(); return; } if (!host[0]) { realNext(); return; }
// if so, remove non-allowed characters // 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 there were unallowed characters, complain
if (!gl.__sni_allow_dangerous_names && safehost.length !== host[0].length) { if (!gl.__sni_allow_dangerous_names && safehost.length !== host[0].length) {
@ -513,7 +513,7 @@ Greenlock.create = function (gl) {
// make lowercase // make lowercase
if (!gl.__sni_preserve_case) { if (!gl.__sni_preserve_case) {
host[0] = host[0].toLowerCase(); host[0] = safehost;
req.headers.host = host.join(':'); req.headers.host = host.join(':');
} }

查看文件

@ -1,6 +1,6 @@
{ {
"name": "greenlock", "name": "greenlock",
"version": "2.3.12", "version": "2.3.13",
"description": "Let's Encrypt for node.js on npm", "description": "Let's Encrypt for node.js on npm",
"main": "index.js", "main": "index.js",
"files": [ "files": [