https://bz.apache.org/bugzilla/show_bug.cgi?id=64770

Christopher Schultz <ch...@christopherschultz.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #3 from Christopher Schultz <ch...@christopherschultz.net> ---
Your problem is that the request line ends with [space][cr][lf] when the
protocol requires that it end with [cr][lf].

Both Tomcat 8.5 and Tomcat 9 will fail with a similar error. Try it:

(With extra space)
$ echo "GET / " | nc localhost 8080
[response: 400 Bad Request]

(Without extra space)
$ echo "GET /" | nc localhost 8080
[response: 400 Not Found]

I just tested on 8.5 and this is how it behaves.

If you want to add Connection:close header (which is further invalid in HTTP
9.0, by the way), you can do:

(With extra space)
$ echo "GET / 
Connection:close" | nc localhost 8080
[response: 400 Bad Request]

(Without extra space)
$ echo "GET /
Connection: close" | nc localhost 8080
[response: 400 Not Found]

You cannot "fix" this with Tomcat configuration. You are violating multiple
parts of the HTTP specification and Tomcat is properly refusing you because of
it.

-- 
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