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

Revert including ASGI root_path in url to validate #47

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

pburke-mdsol
Copy link
Contributor

@pburke-mdsol pburke-mdsol commented Jan 23, 2024

The issue I attempted to fix in #46 it turns out was due to Starlette not implementing that part of the ASGI spec correctly. path is supposed to already include root_path. It looks like this was fixed in a combination of encode/starlette#2352 and encode/starlette#2400 with the latter one being the change that made the incorrect fix I made start to break with Starlette >= 0.35.0.

I have updated FastAPI used in the tests to the latest version and fixed a few unrelated tests that broke because of that. I also reverted the code change I made in #46 but left the test.

Starlette instantiates middleware lazily now so
`app.build_middleware_stack()` have been added to the tests checking for
exceptions when the `MAuthASGIMiddleware` class is instantiated.
The ASGI spec states that path should always include root_path already.
Starlette did not correctly implement this part of the spec, but as of
the v0.35.0 release now does.
@pburke-mdsol pburke-mdsol marked this pull request as ready for review January 23, 2024 14:47
Copy link
Contributor

@ejinotti-mdsol ejinotti-mdsol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh.. fun stuff! looks good, i guess we need a tiny version bump and changelog entry?

@pburke-mdsol
Copy link
Contributor Author

oh.. fun stuff! looks good, i guess we need a tiny version bump and changelog entry?

Yes, I forgot to add those. Will do so in a few.

Copy link
Contributor

@ykitamura-mdsol ykitamura-mdsol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR looks good to me.
it seems we need to update the GHA files so let me open a small PR

@ykitamura-mdsol
Copy link
Contributor

I think it's going to make conflicts so I'll rebase my PR after this one

@ejinotti-mdsol ejinotti-mdsol merged commit 697c471 into main Jan 23, 2024
14 checks passed
@ejinotti-mdsol ejinotti-mdsol deleted the revert-rootpath-change branch January 23, 2024 18:19
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.

3 participants