Skip to content

Commit

Permalink
Add remote address NPE check
Browse files Browse the repository at this point in the history
(cherry picked from commit b7e4f0a)
  • Loading branch information
michalvavrik authored and gsmet committed Sep 13, 2023
1 parent 17ac0c2 commit db37174
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public ForwardedProxyHandler(TrustedProxyCheck.TrustedProxyCheckBuilder proxyChe

@Override
public void handle(HttpServerRequest event) {
if (event.remoteAddress().isDomainSocket()) {
if (event.remoteAddress() == null) {
// client address may not be available with virtual http channel
LOGGER.debug("Client address is not available, 'Forwarded' and 'X-Forwarded' headers are going to be ignored");
handleForwardedServerRequest(event, denyAll());
} else if (event.remoteAddress().isDomainSocket()) {
// we do not support domain socket proxy checks, ignore the headers
LOGGER.debug("Domain socket are not supported, 'Forwarded' and 'X-Forwarded' headers are going to be ignored");
handleForwardedServerRequest(event, denyAll());
Expand Down

0 comments on commit db37174

Please sign in to comment.