Closed jak574 closed 3 months ago
Did you fix this in #2087?
Did you fix this in #2087?
No, this behavior occurs post #2087. Prior to that change going to http://localhost:3333/labs/api/v1/burstcube/too resulted in a {"detail":"Method Not Allowed"}
return, which was definitely not a good default behavior.
I would say here that not having the trailing slash is "more correct" for how an API URL like this should be. The reason I posted this issue is that the 404 when you add the slash only occurs when running inside the GCN environment, and if I run the API stand alone, it does not happen, which makes me think this is related to how the GCN code is handling the routes to /labs/api
.
Bug Report Details :warning::bug:
Description
There's an odd behavior with ACROSS API endpoints, where if a trailing slash is added, it results in a 404.
For example, this URL: https://dev.gcn.nasa.gov/labs/api/v1/burstcube/too works fine and reports a JSON as expected, but the following URL with a trailing slash https://dev.gcn.nasa.gov/labs/api/v1/burstcube/too/ fails with a 404.
The 404 page URL does not match the input one (https://dev.gcn.nasa.gov/burstcube/too).
I tested the API code running under Uvicorn and the behavior is as expected, so I believe this is not an issue with FastAPI.
Steps to Reproduce
Expected behavior: https://dev.gcn.nasa.gov/labs/api/v1/burstcube/too/ and links like this reports a JSON as expected
Actual behavior: Reports a 404.