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 circular redirects caused by wildcards in paths #4633

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

Jongmassey
Copy link
Contributor

fixes #4545

@Jongmassey Jongmassey linked an issue Sep 30, 2024 that may be closed by this pull request
@Jongmassey Jongmassey force-pushed the Jongmassey/Pages-with-Redirect-Error branch from 7c54f0e to dcaf726 Compare October 1, 2024 08:26
@Jongmassey Jongmassey marked this pull request as ready for review October 1, 2024 08:26
redirects/middleware.py Outdated Show resolved Hide resolved
Jongmassey and others added 2 commits October 3, 2024 13:24
We allow underscores in project and workspace names.

When finding redirects, we search for redirects whose `old_url` is at
the beginning of the requested URL.

Previous approaches hand-constructed the SQL WHERE clause with a LIKE
operator which was buggy due to underscores being LIKE wildcards.

With this approach, Django generates the WHERE clause with all the
necessary escaping of characters in `old_url` that could be interpreted
as wildcards.

Co-authored-by: Mike Kelly <mike.kelly@thedatalab.org>
@Jongmassey Jongmassey merged commit f783726 into main Oct 4, 2024
7 checks passed
@Jongmassey Jongmassey deleted the Jongmassey/Pages-with-Redirect-Error branch October 4, 2024 13:31
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.

Pages with Redirect Error
4 participants