Skip to content

Conversation

alukach
Copy link
Member

@alukach alukach commented Sep 6, 2025

We expect that upstream STAC APIs will set the origin of URLs contained in the href property of the links array to be properly pointed to the STAC Auth Proxy URL based on the Forwarded header we provide. However, in certain configurations, upstream APIs don't perform this change (e.g. the proxy headers are not properly forwarded to the upstream STAC API via a reverse proxy). This PR updates how we rework links to ensure that links that have an origin and path matching the path of the upstream STAC API will be reworked to instead point to the origin and potential path of the STAC Auth Proxy.

@github-actions github-actions bot added the fix label Sep 6, 2025
…transformation

- Added `get_base_url` utility to reconstruct the client's base URL from forwarded headers.
- Updated `ProcessLinksMiddleware` to utilize the new utility for transforming links in responses.
- Improved link transformation logic to handle various scenarios, including different hostnames and ports.
- Refactored tests for `ProcessLinksMiddleware` to cover new functionality and edge cases.
@alukach alukach force-pushed the fix/improved-link-processing branch from eadb37f to 8e0d07b Compare September 6, 2025 02:03
@alukach alukach marked this pull request as ready for review September 6, 2025 02:15
@alukach alukach merged commit e52b5a9 into main Sep 8, 2025
4 checks passed
@alukach alukach deleted the fix/improved-link-processing branch September 8, 2025 15:28
alukach pushed a commit that referenced this pull request Sep 8, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.9.2](v0.9.1...v0.9.2)
(2025-09-08)


### Bug Fixes

* improve link processing
([#95](#95))
([e52b5a9](e52b5a9))
* properly return error on invalid CQL2 filters
([5c5c856](5c5c856))


### Documentation

* enhance middleware stack documentation with detailed descriptions and
execution order
([06b51cb](06b51cb))
* update filter class path syntax
([a7f5b1b](a7f5b1b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: ds-release-bot[bot] <116609932+ds-release-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant