Commit 7c63f08f authored by Jacob Vosmaer's avatar Jacob Vosmaer

Merge branch 'custom-header' into 'master'

Use our own header instead of User-Agent

This will still help routing in HTTP proxies, while also allowing
gitlab-rails to see the User-Agent.

See merge request !6
parents 4dbd58a2 9b25046c
...@@ -153,9 +153,9 @@ func (h *gitHandler) doAuthRequest(r *http.Request) (result *http.Response, err ...@@ -153,9 +153,9 @@ func (h *gitHandler) doAuthRequest(r *http.Request) (result *http.Response, err
// This allows the Host header received by the backend to be consistent with other // This allows the Host header received by the backend to be consistent with other
// requests not going through gitlab-git-http-server. // requests not going through gitlab-git-http-server.
authReq.Host = r.Host authReq.Host = r.Host
// Set custom user agent for the request. This can be used in some // Set a custom header for the request. This can be used in some
// configurations (Passenger) to solve auth request routing problems. // configurations (Passenger) to solve auth request routing problems.
authReq.Header.Set("User-Agent", "gitlab-git-http-server") authReq.Header.Set("GitLab-Git-HTTP-Server", Version)
return h.httpClient.Do(authReq) return h.httpClient.Do(authReq)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment