-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
When a url contains colon, it makes 404 response. After I upgrade fastapi from 0.75.0 to 0.77.1. #4892
Comments
This is not FastAPI issue, that is starlette issue. from starlette.routing import compile_path
from starlette import __version__
print(__version__)
print(compile_path("/files:upload_homework")) Here is my result 0.17.1
(re.compile('^/files:upload_homework$'), '/files:upload_homework', {})
0.19.1
(re.compile('^/files$'), '/files:upload_homework', {}) So you can see that starlette use different reget to math url path # 0.19.1
path_regex += re.escape(path[idx:].split(":")[0]) + "$"
# 0.17.1
path_regex += re.escape(path[idx:]) + "$" So you should not use |
Thank you for reply. We use google API design standard in my team. (https://cloud.google.com/apis/design/custom_methods?hl=zh-cn) Maybe I should make an issue to starlette for this. |
We have the same problem. As a workaround you can append |
Starlette 0.20.2 contains a fix for this. We've just released that version. :) |
Wouldn't it be worth having a warning or something in documentation? This is a pretty major regression. |
It is already fixed in starlette. The dependency "just" needs to be updated in fastapi now. |
This issue is fixed in fastapi 0.85.0. |
Thanks for the help here everyone! 👏 🙇 If that solves the original problem, then you can close this issue @kevinGan ✔️ |
Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
First Check
Commit to Help
Example Code
Description
It works in below packages:
It can not works below packages:
Operating System
Linux, macOS
Operating System Details
No response
FastAPI Version
0.77.1
Python Version
Python 3.9.12
Additional Context
No response
The text was updated successfully, but these errors were encountered: