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.
This commit is contained in:
Tatsuhiro Tsujikawa 2020-04-18 17:11:49 +09:00
parent c60ea227cc
commit 854e9fe395
1 changed files with 1 additions and 2 deletions

View File

@ -447,8 +447,7 @@ ClientHandler::ClientHandler(Worker *worker, int fd, SSL *ssl,
*p = '\0'; *p = '\0';
forwarded_for_ = StringRef{buf.base, p}; forwarded_for_ = StringRef{buf.base, p};
} else if (!faddr_->accept_proxy_protocol && } else {
!config->conn.upstream.accept_proxy_protocol) {
init_forwarded_for(family, ipaddr_); init_forwarded_for(family, ipaddr_);
} }
} }