From 03872bfacd441c0af6724b4b216d31b0b5dc6593 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 1 Feb 2016 23:31:21 +0900 Subject: [PATCH] nghttpx: Don't quote Forwarded "by" parameter if it is special value "localhost" --- src/shrpx_http.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shrpx_http.cc b/src/shrpx_http.cc index bada1c50..86870435 100644 --- a/src/shrpx_http.cc +++ b/src/shrpx_http.cc @@ -68,9 +68,10 @@ std::string create_forwarded(int params, const StringRef &node_by, std::string res; if ((params & FORWARDED_BY) && !node_by.empty()) { // This must be quoted-string unless it is obfuscated version - // (which starts with "_"), since ':' is not allowed in token. - // ':' is used to separate host and port. - if (node_by[0] == '_') { + // (which starts with "_") or some special value (e.g., + // "localhost" for UNIX domain socket), since ':' is not allowed + // in token. ':' is used to separate host and port. + if (node_by[0] == '_' || node_by[0] == 'l') { res += "by="; res += node_by; res += ";";