Tomcat 8.5: Header missing in the HTTP response

时光毁灭记忆、已成空白 提交于 2019-12-12 02:08:06

问题


Using tomcat8.5 ...I'm not getting the complete response as using tomcat8.0.

There is a difference between this 2 versions about the HTTP request or response?


PUT tomcat8.0 response:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Tue, 23 Aug 2016 08:59:48 GMT

PUT tomcat8.5 response:

HTTP/1.1 200                                
Transfer-Encoding: chunked
Date: Tue, 23 Aug 2016 09:05:20 GMT

I'm using C++ soket methods to send the request.


回答1:


Well, obviously there's a difference in the content of the actual response. However, the Server: header means nothing as far as HTTP 1.1 is concerned, and it carries no special meaning in the protocol.

Technically, the two responses are identical, and carry identical information about the response: this is a chunked-encoded response. End of story.

If you're writing a client that uses HTTP, you should be familiar with RFC 2616, which explains this.




回答2:


Tomcat 8.5 dropped support for the reason phrase. See the migration guide:

HTTP connector changes

HTTP reason phrases have been removed by default, but can be re-enabled using the sendReasonPhrase configuration attribute.

You can reenable it in your Connector configuration, but it'll be gone in Tomcat 9.

<Connector ... sendReasonPhrase="true"> ... </Connector>



来源:https://stackoverflow.com/questions/39120756/tomcat-8-5-header-missing-in-the-http-response

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!