<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/http/ngx_http_parse.c, branch release-1.29.3</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>CONNECT method support for HTTP/1.1.</title>
<updated>2025-10-23T14:40:05+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2025-09-23T11:03:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=42ca3a4576a32d0a912b0bba4088b8169f55ab2d'/>
<id>42ca3a4576a32d0a912b0bba4088b8169f55ab2d</id>
<content type='text'>
The change allows modules to use the CONNECT method with HTTP/1.1 requests.
To do so, they need to set the "allow_connect" flag in the core server
configuration.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The change allows modules to use the CONNECT method with HTTP/1.1 requests.
To do so, they need to set the "allow_connect" flag in the core server
configuration.
</pre>
</div>
</content>
</entry>
<entry>
<title>Added $request_port and $is_request_port variables.</title>
<updated>2025-10-23T14:40:05+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2025-09-29T16:47:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=c8c7beb96f61e2251abbc345357116131cf91c22'/>
<id>c8c7beb96f61e2251abbc345357116131cf91c22</id>
<content type='text'>
The $request_port variable contains the port passed by the client in the
request line (for HTTP/1.x) or ":authority" pseudo-header (for HTTP/2 and
HTTP/3).  If the request line contains no host, or ":authority" is missing,
then $request_port is taken from the "Host" header, similar to the $host
variable.

The $is_request_port variable contains ":" if $request_port is non-empty,
and is empty otherwise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The $request_port variable contains the port passed by the client in the
request line (for HTTP/1.x) or ":authority" pseudo-header (for HTTP/2 and
HTTP/3).  If the request line contains no host, or ":authority" is missing,
then $request_port is taken from the "Host" header, similar to the $host
variable.

The $is_request_port variable contains ":" if $request_port is non-empty,
and is empty otherwise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Proxy: proxy_pass_trailers directive.</title>
<updated>2024-09-13T12:47:56+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2024-09-10T12:48:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=1a64c196a7d43f83a14fec20ce8936e599c92865'/>
<id>1a64c196a7d43f83a14fec20ce8936e599c92865</id>
<content type='text'>
The directive allows to pass upstream response trailers to client.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The directive allows to pass upstream response trailers to client.
</pre>
</div>
</content>
</entry>
<entry>
<title>HTTP: removed unused r-&gt;port_start and r-&gt;port_end.</title>
<updated>2023-11-28T09:57:14+00:00</updated>
<author>
<name>Vladimir Khomutov</name>
<email>vl@wbsrv.ru</email>
</author>
<published>2023-11-28T09:57:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=0db94ba96a00ebfc4a3c55af8eaaf20f971a7c4c'/>
<id>0db94ba96a00ebfc4a3c55af8eaaf20f971a7c4c</id>
<content type='text'>
Neither r-&gt;port_start nor r-&gt;port_end were ever used.

The r-&gt;port_end is set by the parser, though it was never used by
the following code (and was never usable, since not copied by the
ngx_http_alloc_large_header_buffer() without r-&gt;port_start set).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Neither r-&gt;port_start nor r-&gt;port_end were ever used.

The r-&gt;port_end is set by the parser, though it was never used by
the following code (and was never usable, since not copied by the
ngx_http_alloc_large_header_buffer() without r-&gt;port_start set).
</pre>
</div>
</content>
</entry>
<entry>
<title>Reworked multi headers to use linked lists.</title>
<updated>2022-05-30T18:25:33+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2022-05-30T18:25:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=3aef1d693f3cc431563a7e6a6aba6a34e5290f03'/>
<id>3aef1d693f3cc431563a7e6a6aba6a34e5290f03</id>
<content type='text'>
Multi headers are now using linked lists instead of arrays.  Notably,
the following fields were changed: r-&gt;headers_in.cookies (renamed
to r-&gt;headers_in.cookie), r-&gt;headers_in.x_forwarded_for,
r-&gt;headers_out.cache_control, r-&gt;headers_out.link, u-&gt;headers_in.cache_control
u-&gt;headers_in.cookies (renamed to u-&gt;headers_in.set_cookie).

The r-&gt;headers_in.cookies and u-&gt;headers_in.cookies fields were renamed
to r-&gt;headers_in.cookie and u-&gt;headers_in.set_cookie to match header names.

The ngx_http_parse_multi_header_lines() and ngx_http_parse_set_cookie_lines()
functions were changed accordingly.

With this change, multi headers are now essentially equivalent to normal
headers, and following changes will further make them equivalent.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Multi headers are now using linked lists instead of arrays.  Notably,
the following fields were changed: r-&gt;headers_in.cookies (renamed
to r-&gt;headers_in.cookie), r-&gt;headers_in.x_forwarded_for,
r-&gt;headers_out.cache_control, r-&gt;headers_out.link, u-&gt;headers_in.cache_control
u-&gt;headers_in.cookies (renamed to u-&gt;headers_in.set_cookie).

The r-&gt;headers_in.cookies and u-&gt;headers_in.cookies fields were renamed
to r-&gt;headers_in.cookie and u-&gt;headers_in.set_cookie to match header names.

The ngx_http_parse_multi_header_lines() and ngx_http_parse_set_cookie_lines()
functions were changed accordingly.

With this change, multi headers are now essentially equivalent to normal
headers, and following changes will further make them equivalent.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improved logging of invalid headers.</title>
<updated>2021-06-28T15:01:20+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-06-28T15:01:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=7587778a33bea0ce6f203a8c4de18e33f38b9582'/>
<id>7587778a33bea0ce6f203a8c4de18e33f38b9582</id>
<content type='text'>
In 71edd9192f24 logging of invalid headers which were rejected with the
NGX_HTTP_PARSE_INVALID_HEADER error was restricted to just the "client
sent invalid header line" message, without any attempts to log the header
itself.

This patch returns logging of the header up to the invalid character and
the character itself.  The r-&gt;header_end pointer is now properly set
in all cases to make logging possible.

The same logging is also introduced when parsing headers from upstream
servers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In 71edd9192f24 logging of invalid headers which were rejected with the
NGX_HTTP_PARSE_INVALID_HEADER error was restricted to just the "client
sent invalid header line" message, without any attempts to log the header
itself.

This patch returns logging of the header up to the invalid character and
the character itself.  The r-&gt;header_end pointer is now properly set
in all cases to make logging possible.

The same logging is also introduced when parsing headers from upstream
servers.
</pre>
</div>
</content>
</entry>
<entry>
<title>Disabled control characters and space in header names.</title>
<updated>2021-06-28T15:01:18+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-06-28T15:01:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=9ab4d368af63e9c4a0bebc0eda82d668adaa560a'/>
<id>9ab4d368af63e9c4a0bebc0eda82d668adaa560a</id>
<content type='text'>
Control characters (0x00-0x1f, 0x7f), space, and colon were never allowed in
header names.  The only somewhat valid use is header continuation which nginx
never supported and which is explicitly obsolete by RFC 7230.

Previously, such headers were considered invalid and were ignored by default
(as per ignore_invalid_headers directive).  With this change, such headers
are unconditionally rejected.

It is expected to make nginx more resilient to various attacks, in particular,
with ignore_invalid_headers switched off (which is inherently unsecure, though
nevertheless sometimes used in the wild).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Control characters (0x00-0x1f, 0x7f), space, and colon were never allowed in
header names.  The only somewhat valid use is header continuation which nginx
never supported and which is explicitly obsolete by RFC 7230.

Previously, such headers were considered invalid and were ignored by default
(as per ignore_invalid_headers directive).  With this change, such headers
are unconditionally rejected.

It is expected to make nginx more resilient to various attacks, in particular,
with ignore_invalid_headers switched off (which is inherently unsecure, though
nevertheless sometimes used in the wild).
</pre>
</div>
</content>
</entry>
<entry>
<title>Disabled control characters in URIs.</title>
<updated>2021-06-28T15:01:15+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-06-28T15:01:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=0b66bd4be777a5b79c5ae0e7dff89fc6429da0fe'/>
<id>0b66bd4be777a5b79c5ae0e7dff89fc6429da0fe</id>
<content type='text'>
Control characters (0x00-0x1f, 0x7f) were never allowed in URIs, and must
be percent-encoded by clients.  Further, these are not believed to appear
in practice.  On the other hand, passing such characters might make various
attacks possible or easier, despite the fact that currently allowed control
characters are not significant for HTTP request parsing.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Control characters (0x00-0x1f, 0x7f) were never allowed in URIs, and must
be percent-encoded by clients.  Further, these are not believed to appear
in practice.  On the other hand, passing such characters might make various
attacks possible or easier, despite the fact that currently allowed control
characters are not significant for HTTP request parsing.
</pre>
</div>
</content>
</entry>
<entry>
<title>Disabled spaces in URIs (ticket #196).</title>
<updated>2021-06-28T15:01:13+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-06-28T15:01:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=05395f4889cf0b66e8d049921ad19f1a08319150'/>
<id>05395f4889cf0b66e8d049921ad19f1a08319150</id>
<content type='text'>
From now on, requests with spaces in URIs are immediately rejected rather
than allowed.  Spaces were allowed in 31e9677b15a1 (0.8.41) to handle bad
clients.  It is believed that now this behaviour causes more harm than
good.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From now on, requests with spaces in URIs are immediately rejected rather
than allowed.  Spaces were allowed in 31e9677b15a1 (0.8.41) to handle bad
clients.  It is believed that now this behaviour causes more harm than
good.
</pre>
</div>
</content>
</entry>
<entry>
<title>Added CONNECT method rejection.</title>
<updated>2021-06-28T15:01:04+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2021-06-28T15:01:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=5f85bb3714a81d158f4d849ad5c61aec2737a9f0'/>
<id>5f85bb3714a81d158f4d849ad5c61aec2737a9f0</id>
<content type='text'>
No valid CONNECT requests are expected to appear within nginx, since it
is not a forward proxy.  Further, request line parsing will reject
proper CONNECT requests anyway, since we don't allow authority-form of
request-target.  On the other hand, RFC 7230 specifies separate message
length rules for CONNECT which we don't support, so make sure to always
reject CONNECTs to avoid potential abuse.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No valid CONNECT requests are expected to appear within nginx, since it
is not a forward proxy.  Further, request line parsing will reject
proper CONNECT requests anyway, since we don't allow authority-form of
request-target.  On the other hand, RFC 7230 specifies separate message
length rules for CONNECT which we don't support, so make sure to always
reject CONNECTs to avoid potential abuse.
</pre>
</div>
</content>
</entry>
</feed>
