From 854e9fe395e928d31650a0f398897cc209064c90 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 18 Apr 2020 17:11:49 +0900 Subject: [PATCH] nghttpx: Always call init_forwarded_for Always call init_forwarded_for to get the default when source address in PROXY protocol is ignored. This ensures that forwarded header field has the same value as x-forwarded-for. --- src/shrpx_client_handler.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 81ccbaaa..2b6638a6 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -447,8 +447,7 @@ ClientHandler::ClientHandler(Worker *worker, int fd, SSL *ssl, *p = '\0'; forwarded_for_ = StringRef{buf.base, p}; - } else if (!faddr_->accept_proxy_protocol && - !config->conn.upstream.accept_proxy_protocol) { + } else { init_forwarded_for(family, ipaddr_); } }