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

allow the app to be hosted at a prefix in script_name but still validate against allowed servers #263

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

mmerickel
Copy link
Member

@mmerickel mmerickel commented Dec 7, 2024

If you use rutter or anything else to host a WSGI app at a path prefix then you'll have a non-empty request.script_name. This hasn't previously been supported in pyramid_openapi3 because the path_pattern did not have the prefix included.

The openapi-core is expecting that urljoin(host_url, path_pattern) results in a url that matches something in the servers section + a path in the paths section.

The new script_name based test cases fail without the one-line fix.

Replaces #244.
Fixes #104.

@zupo zupo merged commit 3d16116 into main Dec 7, 2024
3 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.

endpoint validation completely fails if the app is mounted at a subpath
2 participants