URL path with colon (":") results in 404 not found #1673
-
I find that I can't GET or POST to a path containing a colon (":"). An example in FastAPI (which uses Starlette): from fastapi import FastAPI
app = FastAPI()
@app.get("/items:queue")
def queue_new_item():
return "An item has been queued for later inclusion." On I also filed this issue in the fastapi repo (tiangolo/fastapi#4984), but I suspect that Starlette's use of colons for path parameter converters (https://www.starlette.io/routing/) may be playing a role here. Is this a bug? I am trying to follow the official google cloud APIs "custom methods" pattern https://cloud.google.com/apis/design/custom_methods:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
from starlette.routing import compile_path
compile_path("/queries:run") outputs
This seems wrong! |
Beta Was this translation helpful? Give feedback.
-
This was already fixed. I don't recall the version of the fix. 👀 |
Beta Was this translation helpful? Give feedback.
This was already fixed. I don't recall the version of the fix. 👀