fix: prevent infinite loop in enumerate_wildcard_locations#1064
Merged
buchdag merged 1 commit intonginx-proxy:mainfrom Dec 10, 2023
Merged
fix: prevent infinite loop in enumerate_wildcard_locations#1064buchdag merged 1 commit intonginx-proxy:mainfrom
buchdag merged 1 commit intonginx-proxy:mainfrom
Conversation
Member
|
@egormkn thanks for this fix 👍 Do you think it would be possible to update the tests so that the bug you're fixing is covered ? I don't have permission to push to your fork. |
Member
--- a/test/tests/location_config/expected-std-out.txt
+++ b/test/tests/location_config/expected-std-out.txt
@@ -1,7 +1,9 @@
-*.bar.baz.example.com
-*.baz.example.com
+*.bar.baz.com.example.com
+*.baz.com.example.com
+*.com.example.com
*.example.com
-foo.bar.baz.example.*
+foo.bar.baz.com.example.*
+foo.bar.baz.com.*
foo.bar.baz.*
foo.bar.*
foo.*--- a/test/tests/location_config/run.sh
+++ b/test/tests/location_config/run.sh
@@ -54,7 +54,7 @@ function check_location {
}
# check the wildcard location enumeration function
-docker exec "$le_container_name" bash -c 'source /app/functions.sh; enumerate_wildcard_locations foo.bar.baz.example.com'
+docker exec "$le_container_name" bash -c 'source /app/functions.sh; enumerate_wildcard_locations foo.bar.baz.com.example.com'
# default configuration file should be empty
config_path="$vhost_path/default" |
buchdag
approved these changes
Dec 10, 2023
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.
This pull request fixes two issues in
enumerate_wildcard_locationsfunction:descending_wildcard_locationsthe first occurrence oflast_labelwas removed, which might generate wrong wildcards: