mirror of
https://git.phreedom.club/localhost_frssoft/compy.git
synced 2024-11-27 02:21:34 +00:00
Pass through User-Agent from client
Some servers may redirect clients based on their User-Agent. Fixes #66.
This commit is contained in:
parent
aaa43454a9
commit
0602293989
|
@ -138,6 +138,8 @@ func (p *Proxy) handle(w http.ResponseWriter, r *http.Request) error {
|
|||
return fmt.Errorf("error forwarding request: %s", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
user_agent = r.Header().Get("User-Agent")
|
||||
w.Header().Set("User-Agent", user_agent)
|
||||
rw := newResponseWriter(w)
|
||||
rr := newResponseReader(resp)
|
||||
err = p.proxyResponse(rw, rr, r.Header)
|
||||
|
|
Loading…
Reference in a new issue