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 404 errors #3045

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Fix 404 errors #3045

merged 1 commit into from
Nov 25, 2024

Conversation

amCap1712
Copy link
Member

The catch-all index route prevents 404 errors for invalid urls that don't match any view. This is undesirable for API urls, hence check and raise 404 errors if the catch-all view captures an api url.

The catch-all index route prevents 404 errors for invalid urls that
don't match any view. This is undesirable for API urls, hence check
and raise 404 errors if the catch-all view captures an api url.
@amCap1712 amCap1712 merged commit e633229 into master Nov 25, 2024
2 checks passed
@amCap1712 amCap1712 deleted the errors-json branch November 25, 2024 12:52
amCap1712 added a commit that referenced this pull request Jan 4, 2025
#3045 fixed the 404 errors for non-existent urls but the implementation
masks CORS issues with other endpoints. The catch-all index_pages endpoint
, by default, has provide_automatic_options enabled and as a result it
matches OPTIONS requests for non-existent urls or any other endpoints that
have CORS incompletely configured. This makes it harder to debug CORS
issues. To avoid this instead of throwing a 404 after matching, we need
to throw the error during matching itself. Hence, use a custom path
converter that matches all paths except those starting with the api prefix.
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.

2 participants