Skip to content

Tests: map regex capture in rewrite replacement. - #82

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

Tests: map regex capture in rewrite replacement.#82
Aayush7352 wants to merge 1 commit into
nginx:masterfrom
Aayush7352:fix/regex-capture-rewrite-357

Conversation

@Aayush7352

Copy link
Copy Markdown

Summary

Test that a map variable whose value uses a $1 reference from the map regex pattern does not overwrite the rewrite regex captures when used in a rewrite replacement (ticket #357).

What the test covers

  • Default map value (no regex) → rewrite $1 preserved
  • Literal map value (no regex) → rewrite $1 preserved
  • Map regex with capture, used in rewrite $1 → rewrite $1 is the rewrite regex capture, not the map regex capture
  • No rewrite on different URI
  • Default value with map regex non-match

Verified

Without the source fix — 2/6 subtests fail (rewrite $1 gets map regex capture, produces 404):

Failed tests:  3-4

With the source fix — 6/6 subtests pass.

Depends on: nginx/nginx#1573.
Related: nginx/nginx#357.

Test that a map variable whose value uses a $1 reference from
the map regex pattern does not overwrite the rewrite regex
captures when used in a rewrite replacement (ticket #357).
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