-
Notifications
You must be signed in to change notification settings - Fork 96
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 issue with FastAPI mounts. #1183
Conversation
@@ -98,7 +98,11 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: | |||
url = URL(scope=scope).path | |||
root_path = scope.get('root_path') or '' | |||
ends_with_slash = ( | |||
url.endswith('/') and url != '/' and root_path and not url.startswith(root_path + '/api') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this a unit test to enumerate the kinds of URLs that this does/doesn't accept?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
curl --fail --silent "http://localhost:$PORT/lilac_sub/" | ||
curl --fail --silent "http://localhost:$PORT/$MOUNT_PATH/api/v1/tasks/" > /dev/null | ||
curl --fail --silent "http://localhost:$PORT/$MOUNT_PATH/" --max-redirs 0 > /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curl --fail --silent "http://localhost:$PORT/$MOUNT_PATH/" --max-redirs 0 > /dev/null | |
curl --fail --silent "http://localhost:$PORT/$MOUNT_PATH/" -L --max-redirs 0 > /dev/null |
Need to add -L
(follow redirects) for --max-redirs
to have any effect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Done :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to migrate this to a python test, FYI.
No description provided.