diff options
Diffstat (limited to 'internal/serving/serverless/director.go')
-rw-r--r-- | internal/serving/serverless/director.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/internal/serving/serverless/director.go b/internal/serving/serverless/director.go index 83398c0e..83d792c3 100644 --- a/internal/serving/serverless/director.go +++ b/internal/serving/serverless/director.go @@ -1,15 +1,18 @@ package serverless -import "net/http" +import ( + "net/http" + "strings" +) // NewDirectorFunc returns a director function capable of configuring a proxy // request func NewDirectorFunc(cluster Cluster) func(*http.Request) { - return func(r *http.Request) { - // request.Host = domain - // request.URL.Host = domain - // request.URL.Scheme = "https" - // request.Header.Set("User-Agent", "ReverseProxy PoC") - // request.Header.Set("X-Forwarded ...") + return func(request *http.Request) { + request.Host = cluster.Address + request.URL.Host = strings.Join([]string{cluster.Address, cluster.Port}, ":") + request.URL.Scheme = "https" + request.Header.Set("User-Agent", "GitLab Pages Daemon") + request.Header.Set("X-Forwarded-For", "123") // TODO } } |