Am 2019-04-02 um 04:53 schrieb Christopher Schultz:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Michael,
On 3/31/19 04:03, micha...@apache.org wrote:
This is an automated email from the ASF dual-hosted git
repository.
michaelo pushed a commit to branch wrong-http2-version in
repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 0e1de0d34302cdea6b3c2a47b03dcca4c7e2f9b7 Author: Michael
Osipov <micha...@apache.org> AuthorDate: Sun Mar 31 10:03:29 2019
+0200
Fix wrong protocol version usage
When serving a HTTP/2 request the protocol version was set as
"HTTP/2.0" which does not exist. ---
java/org/apache/coyote/http2/Stream.java | 2 +- 1 file changed, 1
insertion(+), 1 deletion(-)
diff --git a/java/org/apache/coyote/http2/Stream.java
b/java/org/apache/coyote/http2/Stream.java index 3e64329..437279a
100644 --- a/java/org/apache/coyote/http2/Stream.java +++
b/java/org/apache/coyote/http2/Stream.java @@ -126,7 +126,7 @@
class Stream extends AbstractStream implements HeaderEmitter {
this.coyoteRequest.setSendfile(handler.hasAsyncIO() &&
handler.getProtocol().getUseSendfile());
this.coyoteResponse.setOutputBuffer(http2OutputBuffer);
this.coyoteRequest.setResponse(coyoteResponse); -
this.coyoteRequest.protocol().setString("HTTP/2.0"); +
this.coyoteRequest.protocol().setString("HTTP/2"); if
(this.coyoteRequest.getStartTime() < 0) {
this.coyoteRequest.setStartTime(System.currentTimeMillis()); }
Does this all come down to what is shown in the log files and what is
returned by request.getProtocol() for servlets to consume? It isn't an
issue with an HTTP/2 response at all.
Correct,
Looks like it should be "HTTP/2.0", based upon these references:
RFC 7540 (HTTP/2)
Status line contains neither protocol nor status text: only the
numeric code.
https://tools.ietf.org/html/rfc7540#section-3.1
JavaEE javadoc for HttpServletRequest#getProtocol:
"
Returns the name and version of the protocol the request uses in the
form protocol/majorVersion.minorVersion, for example, HTTP/1.1. For
HTTP servlets, the value returned is the same as the value of the CGI
variable SERVER_PROTOCOL.
"
If we want to change what HttpServletRequest.getProtocol returns, I
think we need to get agreement from the Servlet EG about an exception
for HTTP/2 because anyone reading the documentation for that method
should expect a ".0" on the end of "HTTP/2".
This is of course an argumentation I cannot resist to agree, though the
documentatin of %r is wrong:
%r - First line of the request (method and request URI)
It misses the protocol. Also for the sake of consistency I'd like to see:
coyoteRequest.protocol().setString(Constants.HTTP_20);
I'll drop the PR.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org