Tests: $body_bytes_sent with early hints - #90
Open
SEPURI-SAI-KRISHNA wants to merge 1 commit into
Open
Conversation
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Adds
proxy_early_hints_bytes.t.Companion to nginx/nginx#1606 — this test does not
pass until that change lands.
Bytes written for a 103 (Early Hints) response are header bytes and should not
be counted in
$body_bytes_sent. The upstream returns an 8-byte body, so$body_bytes_sentmust be 8 whether or not early hints are sent.Covers HTTP/1.1 with
early_hintson, HTTP/1.1 withearly_hintsoff as acontrol, and HTTP/2 — HTTP/2 already accumulates
r->header_sizecorrectly,so it guards against a regression in the other direction.
Against current nginx master:
The 79 is 8 body bytes plus the 71-byte 103 response. The two control cases
pass unchanged, which is what pins the bug to HTTP/1.x with early hints
enabled.
With the fix applied:
The test is not vacuous: the first assertion checks a 103 was actually
emitted, so it cannot pass by early hints silently not firing.
Needs only
http_v2andproxy, so no leg of it is skipped on a defaultbuild.
Checklist
README.mdand/orCHANGELOG.md).