Bug 59313 - module mod_http2 - incorrect protocol version string.
Summary: module mod_http2 - incorrect protocol version string.
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_http2 (show other bugs)
Version: 2.4.18
Hardware: All All
: P2 trivial (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-12 17:56 UTC by D. Stussy
Modified: 2016-04-20 11:17 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description D. Stussy 2016-04-12 17:56:27 UTC
RFC 3875 defines the HTTP version number as "<major>.<minor>" for the purposes of the CGI variable "SERVER_PROTOCOL".  This implementation simply has "HTTP/2", which has no minor number.

Change line 408 of file modules/http2/h2_request.c to read "HTTP/2.0".

     ap_parse_uri(r, req->path);
-    r->protocol = (char*)"HTTP/2";
+    r->protocol = (char*)"HTTP/2.0";
     r->proto_num = HTTP_VERSION(2, 0);

RFC 7540 did NOT override RFC 3875 but claims backward compatibility.  Granted that RFC 7540 refers to the second, binary implementation of HTTP as "HTTP/2", that was insufficient to override the ABNF syntax for the CGI interface in the absence of an affirmation of such an override.

RFC 3875, Section 4.1.16 ABNF:

    HTTP-Version      = "HTTP" "/" 1*digit "." 1*digit

The "minor" number is not optional.
Comment 1 Stefan Eissing 2016-04-13 07:56:05 UTC
Since you already triggered the discussion on the http wg mailing, let's see what the outcome of that will be.

In the meantime, if you have incompatibilities with existing CGI deployments, have you tried

  H2SerializeHeaders on

for those? This is the mod_http2 backward compatibility switch that runs all requests as if there had been come via HTTP/1.1.
Comment 2 Micha Lenk 2016-04-15 06:56:52 UTC
Just for the records, also the HTTP protocol should include the minor version in the HTTP version. This is defined in RFC 7230, section 2.6.
https://tools.ietf.org/html/rfc7230#section-2.6
Comment 3 Micha Lenk 2016-04-15 07:00:04 UTC
RFC 7230 is only relevant for HTTP/1.1 I guess. Sorry for the noise.
Comment 4 Stefan Eissing 2016-04-20 11:15:12 UTC
Changed in trunk with r1740108, 2.4.x with r1740112.