﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1551	nginx returns 400 beacuse of missing host header when receiving HTTP2 :authory pseudo field	https://stackoverflow.com/users/795910/ottavio-campana		"I have a client that connects to the webserver. After sending the magic to upgrade to HTTP2, I have an exchange of settings and one request is POSTed to the server.

Nignx returns 400 and by checking in the error file; I find this

{{{
client sent invalid host header while reading client request headers, client: 127.0.0.1, server: localhost, host: """"
}}}

It's true, the {{{Host:}}} header is missing. But this is no longer an HTTP/1.1 session, it is an upgraded HTTP/2 connection now. The client sends in the {{{SETTINGS}}} packet the {{{:authority}}} pseudo-field.

In section §8.1.2.3 of https://tools.ietf.org/html/rfc7540 it is written

  Clients that generate HTTP/2 requests directly SHOULD use the "":authority"" pseudo-header field instead of the Host header field.

Therefore I think that in this case Nginx should:
* check that {{{:authority}}} is present
* recognize as valid the empty {{{:authory}}} pseudo-field according to RFC3986
* not give an error because the {{{Host:}}} header is missing."	defect	closed	minor		other	1.13.x	invalid			Linux beaglebone 4.9.78-ti-r94 #1 SMP PREEMPT Fri Jan 26 21:26:24 UTC 2018 armv7l GNU/Linux	"nginx version: nginx/1.13.12
built with OpenSSL 1.1.0f  25 May 2017
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/root/nginx=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_perl_module=dynamic --with-http_random_index_module --with-http_secure_link_module --with-http_sub_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --add-dynamic-module=/root/nginx/debian/modules/http-headers-more-filter --add-dynamic-module=/root/nginx/debian/modules/http-auth-pam --add-dynamic-module=/root/nginx/debian/modules/http-auth-digest --add-dynamic-module=/root/nginx/debian/modules/http-cache-purge --add-dynamic-module=/root/nginx/debian/modules/http-dav-ext --add-dynamic-module=/root/nginx/debian/modules/http-ndk --add-dynamic-module=/root/nginx/debian/modules/http-echo --add-dynamic-module=/root/nginx/debian/modules/http-fancyindex --add-dynamic-module=/root/nginx/debian/modules/nchan --add-dynamic-module=/root/nginx/debian/modules/http-lua --add-dynamic-module=/root/nginx/debian/modules/rtmp --add-dynamic-module=/root/nginx/debian/modules/http-uploadprogress --add-dynamic-module=/root/nginx/debian/modules/http-upstream-fair --add-dynamic-module=/root/nginx/debian/modules/http-subs-filter"
