Bug 60784

Summary: HTTP status line tests ignore trailing space after status code in status line (incomplete RFC test)
Product: Tomcat 8 Reporter: Michael Osipov <michaelo>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: 8.5.11   
Target Milestone: ----   
Hardware: All   
OS: All   
Attachments: Test for trailing space in status line

Description Michael Osipov 2017-02-28 12:23:27 UTC
Created attachment 34783 [details]
Test for trailing space in status line

RFC mandates for status line a mandatory space (U+0020) and optional reason phrase. Several tests do not check for or even trim the status line.

The attached patch adds the space to the tests.
Comment 1 Mark Thomas 2017-03-01 14:54:17 UTC
The tests in question aren't (explicitly) testing the format of the status line. They are testing that the correct status code is returned.

I don't see any harm in expanding the tests to check for the space. I'll apply the patch shortly.
Comment 2 Michael Osipov 2017-03-01 15:01:31 UTC
(In reply to Mark Thomas from comment #1)
> The tests in question aren't (explicitly) testing the format of the status
> line. They are testing that the correct status code is returned.
> 
> I don't see any harm in expanding the tests to check for the space. I'll
> apply the patch shortly.

That's true, but some other tests do include the space character. This simply cleans up the remaining tests and adds the extra check for free. It is rather trivial.
Comment 3 Mark Thomas 2017-03-01 15:20:56 UTC
Thanks. Patch applied.