1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

fix(proxy): remove code duplication BE-11627 (#644)

This commit is contained in:
andres-portainer 2025-04-14 17:46:40 -03:00 committed by GitHub
parent 2c37f32fa6
commit 730c1115ce
6 changed files with 9 additions and 10 deletions

View file

@ -10,7 +10,7 @@ import (
// newSingleHostReverseProxyWithHostHeader is based on NewSingleHostReverseProxy
// from golang.org/src/net/http/httputil/reverseproxy.go and merely sets the Host
// HTTP header, which NewSingleHostReverseProxy deliberately preserves.
func newSingleHostReverseProxyWithHostHeader(target *url.URL) *httputil.ReverseProxy {
func NewSingleHostReverseProxyWithHostHeader(target *url.URL) *httputil.ReverseProxy {
targetQuery := target.RawQuery
director := func(req *http.Request) {
req.URL.Scheme = target.Scheme