Skip to content

Commit

Permalink
Add remote address NPE check
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik authored and geoand committed Sep 11, 2023
1 parent bcd2edb commit b7e4f0a
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 b7e4f0a

Please sign in to comment.