-----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. Looks like it should be "HTTP/2.0", based upon these references: RFC 2068 (HTTP/1.1) Status line is definitely "HTTP" +"/" + DIGIT + "." + DIGIT https://tools.ietf.org/html/rfc2068#section-3.1 RFC 2616 (HTTP/1.1) Status line is definitely "HTTP" +"/" + DIGIT + "." + DIGIT https://tools.ietf.org/html/rfc2616#section-3.1 RFC 7230 (HTTP/1.1, Message Syntax and Routing) Status line is definitely "HTTP" +"/" + DIGIT + "." + DIGIT https://tools.ietf.org/html/rfc7230#section-2.6 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". - -chris -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlyizq0ACgkQHPApP6U8 pFiLnBAAjU4BkfFthMICpbSJ7E5PSY29spZn+AxOBZSuBn1Gdr1MWt7z7i/5x4oi keUlv6J+Fu7Tbn1XLkNtkg0cV9rLvXHQYtlAFpGdsF9e+J6+yEralPJueLnsehRk y2QhV71G6jkhDiWvZuNRctHNjHa7koM4oSwOAnJlJDPYouW4gAKHvnGKN20xs7Cd rzNA+6edF87WLHZvQ9WqmpIppyIAz2phDfWKqItHx61is76lEhimYbdVllA7GJID NZF8FbPclxVgkp/gkju8cNTEVWaqgsAYvZFnIV/5pCkGKaIzOPvgeTb90VWREQIf 3sKUdN4RrVNXsd8gV15WVoyGFsIGtRp/NicILDKB+AVI42+khfl/2JMWEYvIjTtm gXR969Ew5DMFMv+7QTHao9dhoPJ3rYnemtU8ext2hREjCkl8AJhe3tYxWaMUNme8 /gqtwlw9oe7hte07Y7O6dbwg1Zml1/6ls4drXU30bBfCpJM7mPIWOpE4Wt88kUUj Q7T2oUFzaM63w5Dw+V6F8OVcLUoqWze8rrWo2Z8KEc2fIbzJEZEkjnBVNImlTY2L 2mcobM30QGGUL2iyehaG8/zXY0foOje5mGoGN0CPu9EDXy64csKMtoe4wZ6kxo2/ 1gBKbOsmkyQxSdbtqL1K4OcMoJY4g4t/XMTSINHc8wC4FuU1SzI= =NrG4 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org