Skip to content

Commit

Permalink
Issue #5443 - Forwarding Headers are optional
Browse files Browse the repository at this point in the history
Additional NPE safety checks.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Oct 13, 2020
1 parent ea11030 commit 457025b
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -522,8 +522,9 @@ else if (forwarded._secureScheme)
// Don't change port if port == IMPLIED.

// Update authority if different from metadata
if (!host.equalsIgnoreCase(requestURI.getHost()) ||
port != requestURI.getPort())
if (requestURI != null && host != null &&
(!host.equalsIgnoreCase(requestURI.getHost()) ||
port != requestURI.getPort()))
{
httpFields.put(new HostPortHttpField(host, port));
request.setAuthority(host, port);
Expand Down

0 comments on commit 457025b

Please sign in to comment.