Bug 62685

Summary: Changes to hostname parsing in HttpParser breaks hostname with trailing dot
Product: Tomcat 9 Reporter: AG <yfilmps>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: major CC: ethan.close, yfilmps
Priority: P2    
Version: 9.0.8   
Target Milestone: -----   
Hardware: PC   
OS: Mac OS X 10.1   
Attachments: Possible fix with updated test cases

Description AG 2018-09-06 16:48:03 UTC
Following fix "Enable strict validation of the provided host name and port for all connectors. Requests with invalid host names and/or ports will be rejected with a 400 response. (markt) " is now restricting the use of trailing dot in hostname.

As per RFC 1034 and information on this site http://www.dns-sd.org/trailingdotsindomainnames.html trailing dot is perfectly valid for a hostname.

The fix is very simple and if needed I can contribute to the fix as well.
Please suggest.
Comment 1 AG 2018-09-06 21:03:11 UTC
Created attachment 36134 [details]
Possible fix with updated test cases

Change in the patch simply allows a hostname to end with a dot.
Comment 2 AG 2018-09-06 21:15:10 UTC
This issue seems to exist for the following versions:
- trunk for 9.0.8 onwards
- 8.5.x for 8.5.31 onwards
- 8.0.x for 8.0.52 onwards
- 7.0.x for 7.0.87 onwards

This is the actual fix that causes hostnames with trailing dot to fail:
Comment 3 Mark Thomas 2018-09-12 14:18:49 UTC
Many thanks for the report, the analysis and the patch.

Fixed in:
- trunk for 9.0.13 onwards
- 8.5.x for 8.5.35 onwards
- 7.0.x for 7.0.91 onwards
Comment 4 AG 2018-09-13 15:56:34 UTC
Very much appreciate for the quick resolution. Will test it again once the new releases are out.