Skip to content

Commit

Permalink
Fix #6860 IPv6 Format
Browse files Browse the repository at this point in the history
updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
  • Loading branch information
gregw committed Sep 17, 2021
1 parent de46e0a commit 316b4bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Expand Up @@ -2610,14 +2610,16 @@ private String formatAddrOrHost(String addr)
return addr;
if (getContext() == null || getContext().getContextHandler() == null)
return HostPort.normalizeHost(addr);
switch (getContext().getContextHandler().getIpv6Format())
switch (getContext().getContextHandler().getIPv6Format())
{
case BRACKETED:
return HostPort.normalizeHost(addr);
case UNBRACKETED:
return HostPort.denormalizeHost(addr);
default:
case UNCHANGED:
return addr;
default:
throw new IllegalStateException();
}
}
}
Expand Up @@ -189,6 +189,9 @@ public enum ContextStatus
DESTROYED
}

/**
* The IPv6 Format to use in the servlet request API
*/
public enum IPV6Format
{
BRACKETED,
Expand Down Expand Up @@ -300,13 +303,13 @@ public Context getServletContext()
return _scontext;
}

@ManagedAttribute("The format of IPv6 addresses return from the servlet API")
public IPV6Format getIpv6Format()
@ManagedAttribute("The format of IPv6 addresses returned from the servlet API")
public IPV6Format getIPv6Format()
{
return _ipv6Format;
}

public void setIpv6Format(IPV6Format ipv6Format)
public void setIPv6Format(IPV6Format ipv6Format)
{
_ipv6Format = _ipv6Format;
}
Expand Down

0 comments on commit 316b4bf

Please sign in to comment.