Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement wildcard #36

Merged
merged 1 commit into from
May 11, 2021
Merged

Conversation

sahandevs
Copy link

tests

echo "Simple wildcard purge"

Create "/a/b"
Create "/a/c"
Create "/a/d"
Create "/test"

ShouldHaveKey "/a/b"
ShouldHaveKey "/a/c"
ShouldHaveKey "/a/d"

Purge "/a/*"
ShouldHaveKey "/test"

ShouldNotHaveKey "/a/b"
ShouldNotHaveKey "/a/c"
ShouldNotHaveKey "/a/d"

echo "One wildcard start"

Create "/a/b"
Create "/c/b"
Create "/c/b/t"
ShouldHaveKey "/a/b"
ShouldHaveKey "/c/b"
ShouldHaveKey "/c/b/t"

Purge "/*/b"
ShouldNotHaveKey "/a/b"
ShouldNotHaveKey "/c/b"
ShouldHaveKey "/test"
ShouldHaveKey "/c/b/t"

echo "One wildcard middle"

Create "/a/1/c"
Create "/a/2/c"
ShouldHaveKey "/a/1/c"
ShouldHaveKey "/a/2/c"

Purge "/a/*/c"
ShouldHaveKey "/test"
ShouldNotHaveKey "/a/1/c"
ShouldNotHaveKey "/a/2/c"

echo "multi wildcard"

Create "/a1/b1/c"
Create "/a2/b2/c"
Create "/a2/c1/c"
ShouldHaveKey "/a1/b1/c"
ShouldHaveKey "/a2/b2/c"
ShouldHaveKey "/a2/c1/c"

Purge "/a*/b*/c"
ShouldHaveKey "/test"
ShouldNotHaveKey "/a1/b1/c"
ShouldNotHaveKey "/a2/b2/c"
ShouldHaveKey "/a2/c1/c"

echo "multi wildcard end"

Create "/images/file.png"
Create "/images/file.png?w=100&h=200"
Create "/images/file.png?w=500&h=100"
ShouldHaveKey "/images/file.png"
ShouldHaveKey "/images/file.png?w=100&h=200"
ShouldHaveKey "/images/file.png?w=500&h=100"

Purge "/images/file.png?w=*&h=*"
ShouldHaveKey "/test"
ShouldHaveKey "/images/file.png"
ShouldNotHaveKey "/images/file.png?w=100&h=200"
ShouldNotHaveKey "/images/file.png?w=500&h=100"
Purge "/images/file.png?*"
ShouldHaveKey "/test"
ShouldHaveKey "/images/file.png"
ShouldNotHaveKey "/images/file.png?w=100&h=200"
ShouldNotHaveKey "/images/file.png?w=500&h=100"
Purge "/images/*.png"
ShouldHaveKey "/test"
ShouldNotHaveKey "/images/file.png"

echo "etc"

Create "/images/file1.png"
Create "/images/file2.png"
Create "/images/file1.jpg"
Create "/images/file2.jpg"

ShouldHaveKey "/images/file1.png"
ShouldHaveKey "/images/file2.png"
ShouldHaveKey "/images/file1.jpg"
ShouldHaveKey "/images/file2.jpg"

Purge "/images/*.png"
ShouldNotHaveKey "/images/file1.png"
ShouldNotHaveKey "/images/file2.png"
ShouldHaveKey "/images/file1.jpg"
ShouldHaveKey "/images/file2.jpg"

Create "/images/file1.png"
Create "/images/file1.png?a=1"
Create "/images/file1.png?b=1"
Create "/images/file1.png?a=1&b=3"
ShouldHaveKey "/images/file1.png"
ShouldHaveKey "/images/file1.png?a=1"
ShouldHaveKey "/images/file1.png?b=1"
ShouldHaveKey "/images/file1.png?a=1&b=3"

Purge "/images/file1.png"
ShouldNotHaveKey "/images/file1.png"
ShouldHaveKey "/images/file1.png?a=1"
ShouldHaveKey "/images/file1.png?b=1"
ShouldHaveKey "/images/file1.png?a=1&b=3"

Create "/images/file1.png"
ShouldHaveKey "/images/file1.png"

Purge "/images/file1.png*"
ShouldNotHaveKey "/images/file1.png"
ShouldNotHaveKey "/images/file1.png?a=1"
ShouldNotHaveKey "/images/file1.png?b=1"
ShouldNotHaveKey "/images/file1.png?a=1&b=3"

@denji denji changed the title implement wildcard Implement wildcard May 11, 2021
@denji denji merged commit f5f4889 into nginx-modules:master May 11, 2021
@sahandevs sahandevs deleted the advance-wildcard-support branch May 12, 2021 08:40
@aminvakil
Copy link

For future reference f5f4889 has been moved to unstable branch (#37 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants