438204 getServerName returns IPv6 addresses wrapped in []

This commit is contained in:
Greg Wilkins 2014-07-09 16:44:34 +10:00
parent 42e1a60d65
commit 068ec21419
2 changed files with 10 additions and 7 deletions

View File

@ -18,7 +18,10 @@
package org.eclipse.jetty.http;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
@ -1348,7 +1351,7 @@ public class HttpParserTest
HttpParser.RequestHandler handler = new Handler();
HttpParser parser= new HttpParser(handler);
parser.parseNext(buffer);
assertEquals("::1",_host);
assertEquals("[::1]",_host);
assertEquals(0,_port);
}
@ -1426,7 +1429,7 @@ public class HttpParserTest
HttpParser.RequestHandler handler = new Handler();
HttpParser parser= new HttpParser(handler);
parser.parseNext(buffer);
assertEquals("::1",_host);
assertEquals("[::1]",_host);
assertEquals(8888,_port);
}

View File

@ -485,7 +485,7 @@ public class RequestTest
assertThat(response, Matchers.containsString("200 OK"));
assertEquals("http://[::1]/",results.get(i++));
assertEquals("0.0.0.0",results.get(i++));
assertEquals("::1",results.get(i++));
assertEquals("[::1]",results.get(i++));
assertEquals("80",results.get(i++));
@ -499,7 +499,7 @@ public class RequestTest
assertThat(response, Matchers.containsString("200 OK"));
assertEquals("http://[::1]:8888/",results.get(i++));
assertEquals("0.0.0.0",results.get(i++));
assertEquals("::1",results.get(i++));
assertEquals("[::1]",results.get(i++));
assertEquals("8888",results.get(i++));
@ -515,7 +515,7 @@ public class RequestTest
assertThat(response, Matchers.containsString("200 OK"));
assertEquals("https://[::1]/",results.get(i++));
assertEquals("remote",results.get(i++));
assertEquals("::1",results.get(i++));
assertEquals("[::1]",results.get(i++));
assertEquals("443",results.get(i++));
@ -531,7 +531,7 @@ public class RequestTest
assertThat(response, Matchers.containsString("200 OK"));
assertEquals("https://[::1]:8888/",results.get(i++));
assertEquals("remote",results.get(i++));
assertEquals("::1",results.get(i++));
assertEquals("[::1]",results.get(i++));
assertEquals("8888",results.get(i++));
}