tshttp, derphttp: send Proxy-Authorization, not Authorization, to proxies

Whoops. But weirdly, sending Authorization sometimes worked?
This commit is contained in:
Brad Fitzpatrick
2020-08-28 20:58:14 -07:00
parent 3af2d671e6
commit 1e0be5a458
3 changed files with 20 additions and 4 deletions

View File

@@ -594,7 +594,7 @@ func (c *Client) dialNodeUsingProxy(ctx context.Context, n *tailcfg.DERPNode, pr
if v, err := tshttpproxy.GetAuthHeader(pu); err != nil {
c.logf("derphttp: error getting proxy auth header for %v: %v", proxyURL, err)
} else if v != "" {
authHeader = fmt.Sprintf("Authorization: %s\r\n", v)
authHeader = fmt.Sprintf("Proxy-Authorization: %s\r\n", v)
}
if _, err := fmt.Fprintf(proxyConn, "CONNECT %s HTTP/1.1\r\nHost: %s\r\n%s\r\n", target, pu.Hostname(), authHeader); err != nil {