#6195 [BUG] Update GetPublicURL to match inbound request with most relevant AuthorizedURIs
Issue created by
CtfChan
### Describe the bug
Relevant code (GetPublicURL):
flyte/flyteadmin/auth/handler_utils.go
Line 114 in</flyteorg/flyte/commit/8125ae1b96b4b41e237be396c2e0dd21141117ce|8125ae1>
| func GetPublicURL(ctx context.Context, req *http.Request, cfg *config.Config) *url.URL { |
| ---------------------------------------------------------------------------------------- |
• If the request has a URL attached to it this function will just return the first URI in the AuthorizedURIs. Users of the helm chart might pass multiple AuthorizedURIs.
For example we passed in the following three URIs and this function was constantly picking
http//flyteadmin80 when the request was in fact coming from
https://flyte/.<BASE_URL>
authorizedUris:
- https://flyte/.<BASE_URL>
- http://flyteadmin:80
- http://flyteadmin.flyte.svc.cluster.local:80
### Expected behavior
GetPublicURL function should try to match on hostname of the request and AuthorizedURIs list instead of returning the first element of the list.
### Additional context to reproduce
No response
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flyte