Clear RequestURI in reverse proxy to prevent client RoundTrip rejection. Updated reverse.go to ensure that server-side requests do not carry RequestURI, enhancing compatibility with client requests.
Publish telemt-api gateway Docker image / test (push) Failing after 27s
Publish telemt-api gateway Docker image / build-and-push (push) Has been skipped

This commit is contained in:
Denozordec
2026-03-30 00:24:34 +07:00
parent 5a9b402220
commit 4f91c7227e
+3
View File
@@ -21,6 +21,8 @@ func NewReverseProxy(target *url.URL, stripPrefix, pathPrefix string, setAuth st
if setAuth != "" {
req.Header.Set("Authorization", setAuth)
}
// Server-side requests carry RequestURI; client RoundTrip rejects it with URL.Host set.
req.RequestURI = ""
return
}
rest := strings.TrimPrefix(p, stripPrefix)
@@ -41,6 +43,7 @@ func NewReverseProxy(target *url.URL, stripPrefix, pathPrefix string, setAuth st
if setAuth != "" {
req.Header.Set("Authorization", setAuth)
}
req.RequestURI = ""
}
return proxy
}