438204 getServerName returns IPv6 addresses wrapped in []
This commit is contained in:
parent
ca1a9ceb7c
commit
42e1a60d65
|
@ -48,7 +48,7 @@ public class HostPortHttpField extends HttpField
|
|||
int close=authority.lastIndexOf(']');
|
||||
if (close<0)
|
||||
throw new BadMessageException(HttpStatus.BAD_REQUEST_400,"Bad ipv6");
|
||||
_host=authority.substring(1,close);
|
||||
_host=authority.substring(0,close+1);
|
||||
|
||||
if (authority.length()>close+1)
|
||||
{
|
||||
|
|
|
@ -66,7 +66,7 @@ public class CheckReverseProxyHeadersTest
|
|||
@Override
|
||||
public void validate(HttpServletRequest request)
|
||||
{
|
||||
assertEquals("::1", request.getServerName());
|
||||
assertEquals("[::1]", request.getServerName());
|
||||
assertEquals(80, request.getServerPort());
|
||||
assertEquals("10.20.30.40", request.getRemoteAddr());
|
||||
assertEquals("10.20.30.40", request.getRemoteHost());
|
||||
|
@ -84,7 +84,7 @@ public class CheckReverseProxyHeadersTest
|
|||
@Override
|
||||
public void validate(HttpServletRequest request)
|
||||
{
|
||||
assertEquals("::1", request.getServerName());
|
||||
assertEquals("[::1]", request.getServerName());
|
||||
assertEquals(8888, request.getServerPort());
|
||||
assertEquals("10.20.30.40", request.getRemoteAddr());
|
||||
assertEquals("10.20.30.40", request.getRemoteHost());
|
||||
|
|
Loading…
Reference in New Issue