-
Notifications
You must be signed in to change notification settings - Fork 5
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
Issue with absent trailing slash in stac-fastapi #343
Comments
Just a note: We've actually been seeing this bug for a long time in the dev instance so it is possible that it is unrelated to recent code changes: https://dev.openveda.cloud/api/stac redirects to origin (https://dev.openveda.cloud which is a s3 website stac browser) while https://dev.openveda.cloud/api/stac/ properly directs to the stac api. We hadn't prioritized this work because we didn't realize it was impacting users. We'd been assuming that it was tech debt in smoothing out our cloud front configuration. :( |
For the pagination issue I think there is a missing |
## What Fix problem in which a stac-fastapi deployed behind a proxy (i.e. `customdomain.com`) with a custom root path (i.e. `/api/stac`) - Fixed: API does not properly resolve `customdomain.com/api/stac` -> `customdomain.com/api/stac/` - Fixed: API does not properly use custom root path in next links of paginated responses `customdomain.com/api/stac/...` links are returned as `customdomain.com/...` without the custom root path. The correction is to remove the gateway configuration from the Mangum ASGI handler for the stac-api handler. ### Refs - [Fastapi behind a proxy](https://fastapi.tiangolo.com/advanced/behind-a-proxy/#proxy-with-a-stripped-path-prefix) - [Mangum configuring an adaptar instance with api_gateway_base_path](https://mangum.io/adapter/#configuring-an-adapter-instance_) pattern that we use and need for titiler/raster-api and ingest-api ### Issue #343 ### Testing? - I deployed this change manually to the dev veda-backend stack and confirmed that the stac-api url is properly resolved and that the next links now properly include the root path.
Description
A recent deployment of the veda-backend introduced an issue with the stac-fastapi where absence of a trailing slash causes it to respond with a 307 temporary redirect
See the behavior in
https://dev.openveda.cloud/api/stac vs https://dev.openveda.cloud/api/stac/
We ruled out any infrastructure issue by running it locally:
Downgrading to
stac-fastapi.api==2.4.5
still has the same behavior@amarouane-ABDELHAK @vincentsarago @wildintellect
The text was updated successfully, but these errors were encountered: