Skip to content

Tests: map regex with location captures. - #81

Open
Aayush7352 wants to merge 1 commit into
nginx:masterfrom
Aayush7352:fix/regex-capture-overwrite-244
Open

Tests: map regex with location captures.#81
Aayush7352 wants to merge 1 commit into
nginx:masterfrom
Aayush7352:fix/regex-capture-overwrite-244

Conversation

@Aayush7352

Copy link
Copy Markdown

Summary

Regression test for nginx/nginx#1573 / nginx/nginx#244: map variable with regex must not overwrite request capture state ($1, $2, ...) set by location regex.

What the test covers

  • map with ~/.+$ regex pattern + regex location with captures → $1, $2 have correct values
  • Verify captures work correctly for different URI lengths
  • Verify captures work correctly for short URIs
  • Verify normal location (no regex captures) unaffected
  • Verify captures work when map variable is present in the response body

Verified

All 5 subtests pass with the fix from nginx/nginx#1573. Without the fix, 4/5 fail -- $1 and $2 are empty and Content-Length is over-counted.

Related: nginx/nginx#244, nginx/nginx#1573

Test that a map variable with a regex pattern does not overwrite
request capture state ($1, $2) set by a location regex.
@Aayush7352

Copy link
Copy Markdown
Author

Updated companion test PR #82 adds further coverage for ticket #357 (map regex capture $1 in rewrite replacement).

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