-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Fix link rewriting for edge cases #111
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
base: main
Are you sure you want to change the base?
Conversation
73c3822 to
07ae8c6
Compare
07ae8c6 to
c447ac6
Compare
Can you help me understand this a bit more? In this example, what does
I'm not convinced that we want this. If we have a STAC API running on |
On the cluster the services run with these cluster-internal urls:
Both are then available to the outside of the cluster via the ingress on: Flow:
In the stac-auth-proxy:
|
Good point! You are right, different services can run on different ports. My initial problem was based on the the port the services are externally available not being set properly and the cluster internal port was used instead. This can be solved by setting the However it seems the link processing middle-ware is still not triggered to add back the striped-out |
When using stac-auth-proxy with
ROOT_PATHset, links containinglocalhost:PORT(e.g.,localhost:8080) were not rewritten. The proxy only matched exact netloc strings, solocalhost:8080didn't match localhost, causing 404s when clients followed these links. This is probably a common need for runningstac-fastapibehind a load balancer.This PR proposes:
_extract_hostname()to extract hostnames ignoring ports_hostnames_match()to compare hostnames case-insensitively, ignoring ports_update_link()to compare hostnames instead of exact netloc matches