Correctly set user_agent

Fixes regression from 0602293989.
Closes #69.
This commit is contained in:
Andrew Gaul 2022-03-12 23:30:11 +09:00
parent 0602293989
commit 7dbd021fec

View file

@ -138,7 +138,7 @@ 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")
user_agent := r.Header.Get("User-Agent")
w.Header().Set("User-Agent", user_agent)
rw := newResponseWriter(w)
rr := newResponseReader(resp)