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

--- Comment #59 from mgrigorov <mgrigo...@apache.org> ---
(In reply to thorsten.meinl from comment #58)
> Even if this change doesn't break clients it will give a very bad impression
> to users. For example if you use Java to issue HTTP request and and error
> was returned by the server, the exception message reads "Server returned
> error 404: Not Found" (or similar). Even for uses not knowing the HTTP

$ http http://localhost:8080/aaa
HTTP/1.1 404 
Content-Language: en
Content-Length: 1073
Content-Type: text/html;charset=utf-8
Date: Wed, 03 May 2017 18:35:43 GMT


Those are the response headers returned by Tomcat. 
The client may add "null", emojis, unicorns, ... and Tomcat (or any server) is
not to blame here!


> status code the "Not Found" is descriptive. Therefore I guess many Java
> applications displays the exception message as is. With Tomcat 8.5 the

No! It seems your client shows something it just made up!

> exception message is "Server returned error 404: null". Normal users don't
> have clue any more what's going on and even for programmers this more looks
> like a NullPointerException somewhere deep in the code. In order to restore
> a good user experience you now have to interpret the exception messages and
> create new ones for every possible status code.

Well, the HTTP protocol is pretty old! The error codes are very well known.
If a developer is confused that 404 may mean 500 then I think the time spend on
debugging this problem will be very well spend time in education! This
developer will learn something that will be very useful for him/her for the
rest of his/her career!
If a software (i.e. non-human) makes the mistake then it is really a bug in
this client software. Old clients can use old servers. Tomcat 8.5.x will be
maintained for several more years. Just switch the property on and continue.

> 
> Therefore my question is: why on earth has the reason phrase been removed in
> the first place? In order to save a few bytes of traffic?

The simple answer is that the HTTP specification has been updated. HTTP2 is all
about improvements and optimizations. And this is one of them.
Few bytes here, few bytes there and my web app can serve few more
hundreds/thousands users more!

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