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';
forwarded_for_ = StringRef{buf.base, p};
} else if (!faddr_->accept_proxy_protocol &&
!config->conn.upstream.accept_proxy_protocol) {
} else {
init_forwarded_for(family, ipaddr_);
}
}