Bug 64225 - An exception occurred while parse the given input as an HTTP Host header value
Summary: An exception occurred while parse the given input as an HTTP Host header value
Status: RESOLVED WONTFIX
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Util (show other bugs)
Version: unspecified
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-13 06:44 UTC by zhichun xie
Modified: 2020-03-30 16:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhichun xie 2020-03-13 06:44:04 UTC
https://tools.ietf.org/html/rfc3986#page-18

'host:*' is http compliant, but the request will report an exception:

o.apache.coyote.http11.Http11Processor   : The host [*] is not valid
 Note: further occurrences of request parsing errors will be logged at DEBUG level.

java.lang.IllegalArgumentException: null
	at org.apache.tomcat.util.http.parser.Host.parse(Host.java:78)
	at org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)
	at org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:282)
	at org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:809)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)


The relevant source code is :
https://github.com/apache/tomcat/blob/master/java/org/apache/tomcat/util/http/parser/Host.java
Comment 1 Mark Thomas 2020-03-13 08:25:18 UTC
At the moment, reg-name is further restricted to valid DNS names. What name resolution service are you using?
Comment 2 Mark Thomas 2020-03-30 16:06:22 UTC
Noting that RFC 3986 states that:

<quote>
URI producers should use names that conform to the DNS syntax, even when use of DNS is not immediately apparent
</quote>

and that Tomcat is designed to use DNS;

and that there has been no response for 2 weeks I am closing this as WONTFIX but feel free to re-open if there is a use where Tomcat is used with a name resolution service that does not conform to the DNS syntax.