fix: don't rewrite helm chart URLs pointing to a different host (#56)
## Problem Helm charts like Intel device plugins have download URLs on `github.com` but the chart index is served from `intel.github.io`. The merger rewrites all URLs through the proxy, constructing: ``` https://artifactapi/api/v1/remote/intel-helm/intel/helm-charts/releases/download/... ``` Which proxies to `https://intel.github.io/helm-charts/intel/helm-charts/releases/download/...` — a 404. ## Fix Compare the download URL host against the remote's base URL host. If they differ, leave the URL as-is so helm downloads directly from the source. Same-host URLs are still rewritten through the proxy. Also adds `BaseURL` to `MemberIndex` so the merger has the context it needs, and uses the correct `/local/` vs `/remote/` route prefix. Reviewed-on: #56 Co-authored-by: Ben Vincent <ben@unkin.net> Co-committed-by: Ben Vincent <ben@unkin.net>
This commit was merged in pull request #56.
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
type MemberIndex struct {
|
||||
RemoteName string
|
||||
RepoType models.RepoType
|
||||
BaseURL string
|
||||
Body []byte
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user