Skip to content

Tests: hop-by-hop headers in early hints responses - #89

Open
SEPURI-SAI-KRISHNA wants to merge 1 commit into
nginx:masterfrom
SEPURI-SAI-KRISHNA:early-hints-hop-by-hop-headers
Open

Tests: hop-by-hop headers in early hints responses#89
SEPURI-SAI-KRISHNA wants to merge 1 commit into
nginx:masterfrom
SEPURI-SAI-KRISHNA:early-hints-hop-by-hop-headers

Conversation

@SEPURI-SAI-KRISHNA

Copy link
Copy Markdown

Proposed changes

Adds proxy_early_hints_headers.t.

Companion to nginx/nginx#1604 — this test does not
pass until that change lands.

The upstream sends Connection, Content-Length, Transfer-Encoding,
Keep-Alive and Upgrade in its 103 (Early Hints) response. None of them
should reach the client: they are hop-by-hop header fields (RFC 9110, 7.6.1),
a 1xx response never carries content, and with HTTP/2 and HTTP/3 they make the
informational response malformed (RFC 9113, 8.2.2; RFC 9114, 4.2).

Covers HTTP/1.1, HTTP/2 and HTTP/3. The HTTP/1.1 check is scoped to the 103
header block only, since the final response legitimately carries
Connection and Content-Length.

Against current nginx master the test fails as follows — note that HTTP/2 and
HTTP/3 forward all five fields:

#   Failed test 'no hop-by-hop headers'
#   at proxy_early_hints_headers.t line 96.

#   Failed test 'h2 no hop-by-hop headers'
#   at proxy_early_hints_headers.t line 108.
#          got: 'connection content-length transfer-encoding keep-alive upgrade'
#     expected: ''

#   Failed test 'h3 no hop-by-hop headers'
#   at proxy_early_hints_headers.t line 123.
#          got: 'connection content-length transfer-encoding keep-alive upgrade'
#     expected: ''
# Looks like you failed 3 tests of 12.

With the fix applied:

proxy_early_hints_headers.t .. ok
All tests successful.

The test is not vacuous: if early hints stop being emitted entirely, the
early hints assertion fails first, and the HTTP/1.1 hop-by-hop check would
then be scoped to the final response headers and fail too.

Verified against a build with --with-http_v2_module --with-http_v3_module
and CryptX available, so no leg of the test is skipped.

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants