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

fix: Solve an issue where rewrites due to APPEND_SLASH_FOR_POSSIBLE_DIRECTORY would cause duplication of the query string #209

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

4141done
Copy link
Collaborator

@4141done 4141done commented Feb 6, 2024

What

As reported here #205 when

  • APPEND_SLASH_FOR_POSSIBLE_DIRECTORY=true
  • ALLOW_DIRECTORY_LIST=false
  • PROVIDE_INDEX_PAGE=true
    Are set, requests containing query strings without a trailing slash were being duplicated (foo?a=b were becoming foo?a=b?a=b).

Cause

The rewrite directive will automatically append the query string unless a final trailing ? is supplied. This was causing the duplication

Fix

Added an explanatory comment and a trailing ? to the rewrite rule to prevent automatic appending of the query string as we already do it in the argument to the rewrite rule.

I chose to do this rather than depending on the default behavior of rewrite since the rule as it is expressed is more explicit. The trailing ? is mysterious and so a comment was included to clarify.

…IRECTORY would cause duplication of the query string
@4141done 4141done force-pushed the issue-205-duplicate-query-params branch from 87465ae to 1bfb2bf Compare February 7, 2024 17:33
@4141done 4141done merged commit c687663 into master Feb 7, 2024
7 checks passed
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.

1 participant