Skip to content

Tests: added add_header/add_trailer field sanitization test.#58

Draft
louzt wants to merge 2 commits into
nginx:masterfrom
louzt:upstream/response-filter-sanitize-tests
Draft

Tests: added add_header/add_trailer field sanitization test.#58
louzt wants to merge 2 commits into
nginx:masterfrom
louzt:upstream/response-filter-sanitize-tests

Conversation

@louzt
Copy link
Copy Markdown

@louzt louzt commented May 31, 2026

Summary

This updates the standalone nginx-tests regression for add_header and add_trailer sanitization.

Why

The companion test now covers the maintainer concern raised in review: invalid static field names in add_header/add_trailer should not be serialized either.

That keeps the test aligned with the direct upstream C draft instead of only checking CRLF in values.

What changed

  • keeps the existing add_header/add_trailer CRLF value cases;
  • adds bad-name cases for add_header and add_trailer using a valid sibling field plus an invalid X:Bad field name;
  • verifies that the valid field still appears while the invalid one is skipped;
  • keeps the usual no alerts and no sanitizer errors checks from Test::Nginx.

Validation

  • current nginx/nginx master: header_filter_sanitize.t fails 4/14;
  • patched branch for the companion C change: header_filter_sanitize.t passes 14/14;
  • ASAN/UBSAN build of the patched branch: header_filter_sanitize.t passes 14/14.

Risks / Follow-ups

This test intentionally follows the current draft policy: sanitize bad values in place via a copy and skip bad names entirely. If upstream chooses a different late response-filter policy, the assertions should be updated to match that final design.

@louzt
Copy link
Copy Markdown
Author

louzt commented May 31, 2026

Companion nginx/nginx draft: nginx/nginx#1414

@louzt louzt changed the title Tests: added header filter sanitization test. Tests: added add_header/add_trailer field sanitization test. May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant