Skip to content

Commit

Permalink
Issue #7277 - Adding missing null check
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Jan 5, 2022
1 parent 2eaec36 commit 3199438
Showing 1 changed file with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,6 @@ public String getLocalName()
return null;
}

/**
* @return return the HttpConfiguration server authority override
*/
public HostPort getServerAuthority()
{
HttpConfiguration httpConfiguration = getHttpConfiguration();
if (httpConfiguration != null)
return httpConfiguration.getServerAuthority();

return null;
}

/**
* <p>Return the Local Port of the connected channel.</p>
*
Expand Down Expand Up @@ -379,9 +367,13 @@ public int getLocalPort()

public InetSocketAddress getLocalAddress()
{
SocketAddress localAddress = getHttpConfiguration().getLocalAddress();
if (localAddress instanceof InetSocketAddress)
return ((InetSocketAddress)localAddress);
HttpConfiguration httpConfiguration = getHttpConfiguration();
if (httpConfiguration != null)
{
SocketAddress localAddress = httpConfiguration.getLocalAddress();
if (localAddress instanceof InetSocketAddress)
return ((InetSocketAddress)localAddress);
}

return _endPoint.getLocalAddress();
}
Expand All @@ -391,6 +383,18 @@ public InetSocketAddress getRemoteAddress()
return _endPoint.getRemoteAddress();
}

/**
* @return return the HttpConfiguration server authority override
*/
public HostPort getServerAuthority()
{
HttpConfiguration httpConfiguration = getHttpConfiguration();
if (httpConfiguration != null)
return httpConfiguration.getServerAuthority();

return null;
}

/**
* If the associated response has the Expect header set to 100 Continue,
* then accessing the input stream indicates that the handler/servlet
Expand Down

0 comments on commit 3199438

Please sign in to comment.