diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index 28dfaa90..72f59006 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -880,10 +880,8 @@ int on_response_headers(Http2Session *http2session, } downstream->set_response_http_status(strtoul(status->second.c_str(), nullptr, 10)); - // Just assume it is HTTP/1.1. But we really consider to say 2.0 - // here. - downstream->set_response_major(1); - downstream->set_response_minor(1); + downstream->set_response_major(2); + downstream->set_response_minor(0); auto content_length = http2::get_header(nva, "content-length"); if(!content_length && downstream->get_request_method() != "HEAD" && diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index e77d990f..d309cd4b 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -229,6 +229,11 @@ int on_begin_headers_callback(nghttp2_session *session, upstream->add_downstream(downstream); downstream->init_response_body_buf(); + // Although, we deprecated minor version from HTTP/2, we supply + // minor version 0 to use via header field in a conventional way. + downstream->set_request_major(2); + downstream->set_request_minor(0); + return 0; } } // namespace