Force Jetty 7.0 to Response with HTTP/1.0
I'm using Jetty 7.0 emb开发者_运维问答edded mode and looking for a way to force Jetty to response with HTTP 1.0 and not 1.1 (which seems to be the default).
Is there any setting I can use, to control the protocol version on the server response?
The correct way to get Jetty to send HTTP/1.0 responses is to have the client to send it HTTP/1.0 requests.
By way of justification, consider this paragraph from the HTTP 1.1 specification:
An application that sends a request or response message that includes HTTP-Version of "HTTP/1.1" MUST be at least conditionally compliant with this specification. Applications that are at least conditionally compliant with this specification SHOULD use an HTTP-Version of "HTTP/1.1" in their messages, and MUST do so for any message that is not compatible with HTTP/1.0. For more details on when to send specific HTTP-Version values, see RFC 2145.
In other words, if a client sends HTTP/1.1 requests, it must be capable of dealing with HTTP/1.1 responses. If it is not, then it is violating the HTTP specification ... and all bets are off.
精彩评论