| Summary: | Splitting of host:port fails on IPv6 based host field in HTTP request | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Joakim Eriksson <joakime> |
| Component: | server | Assignee: | Greg Wilkins <gregw> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jetty-inbox, mgorovoy |
| Version: | unspecified | ||
| Target Milestone: | 7.2.x | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
hmmm it is working for me for http://[::1]:8080/dump/info I'll work out how/why (In reply to comment #1) > hmmm it is working for me for http://[::1]:8080/dump/info Greg, I think the problem occurs with http://[::1]/dump/info... Ah yes - fixed in r3160 |
Build Identifier: 7.4.1.v2011-05-13 In the Request.java code the parsing of host:port fails when an IPv6 address is used in the http host field. I have added a suggestion in the below code-snippet that will avoid interpreting one of the colons in an IPv6 address as a port colon. --- for (int i=hostPort.length();i-->0;) { /* support for IPv6 address without ports */ if (hostPort.peek(hostPort.getIndex()+i)==']') { break; } if (hostPort.peek(hostPort.getIndex()+i)==':') { _serverName=BufferUtil.to8859_1_String(hostPort.peek(hostPort.getIndex(), i)); _port=BufferUtil.toInt(hostPort.peek(hostPort.getIndex()+i+1, hostPort.length()-i-1)); return _serverName; } } ---- Reproducible: Always Steps to Reproduce: 1. start up jetty with jetty -jar start.jar jetty.port=80 2. browse to a IPv6 based address (that you happen to have on one of your interfaces - I used aaaa::1 on a microsoft loopback adapter) 3. browse to http:://[aaaa::1]/anything.html