https://issues.apache.org/bugzilla/show_bug.cgi?id=50342

           Summary: Exception on the Host request-header field included
                    colon(':')
           Product: Tomcat 6
           Version: 6.0.26
          Platform: PC
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Connectors
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: kni...@nhn.com


Hello.

If A tomcat receive a request contained the Host request-header field included
colon, java.io.CharConversionException is thrown.

Exception is below
2010. 11. 26 SEVERE 3:43:37 org.apache.jk.common.HandlerRequest invoke
SEVERE: Error decoding request 
java.io.CharConversionException: Invalid char in port: 103
        at
org.apache.jk.common.HandlerRequest.parseHost(HandlerRequest.java:655)
        at
org.apache.jk.common.HandlerRequest.decodeRequest(HandlerRequest.java:403)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:260)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
        at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:619)
2010. 11. 26  SEVERE 3:43:37 org.apache.jk.common.ChannelSocket
processConnection
SEVEREĆ­: processCallbacks status 2
2010. 11. 26SEVERE 3:43:37 org.apache.jk.common.HandlerRequest invoke
SEVERE: Error decoding request 
java.io.CharConversionException: Invalid char in port: 103
        at
org.apache.jk.common.HandlerRequest.parseHost(HandlerRequest.java:655)
        at
org.apache.jk.common.HandlerRequest.decodeRequest(HandlerRequest.java:403)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:260)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
        at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
        at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:619)
2010. 11. 26 SEVERE 3:43:37 org.apache.jk.common.ChannelSocket
processConnection
SEVEREĆ­: processCallbacks status 2


So. the sample request is below :
(Host field contained two domain name ; tomcat.apache.org and www.apache.org)

telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
GET http://myweb.com/search.nhn HTTP/1.1
Accept-Language: ko-KR
User-Agent: Mozilla/4.0
Accept-Encoding: gzip, deflate
Host:  tomcat.apache.org:www.apache.org   
Connection: Keep-Alive

HTTP/1.1 502 Bad Gateway
Date: Fri, 26 Nov 2010 06:43:36 GMT
.....


It looks like the HTTP 1.1 specification allows to do such call, here's the
content of HTTP 1.1 specification.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23

14.23 Host
The Host request-header field specifies the Internet host and port number of
the resource being requested, as obtained from the original URI given by the
user or referring resource (generally an HTTP URL, 

as described in section 3.2.2). The Host field value MUST represent the naming
authority of the origin server or gateway given by the original URL. This
allows the origin server or gateway to differentiate between
internally-ambiguous URLs, such as the root "/" URL of a server for multiple
host names on a single IP address. 

       Host = "Host" ":" host [ ":" port ] ; Section 3.2.2


Because http specification 1.1 support multiple host name, I think tomcat may
support this. If I am wrong, let me know it. 
Every tomcat I tested show the exception. 

Thank you.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to