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

Use custom converter for catch-all index path #3112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amCap1712
Copy link
Member

#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.

#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.
@amCap1712 amCap1712 requested a review from mayhem January 8, 2025 09:05
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