Always append apparent remote address of sender to user in proxy auth. Non-Local clients will get their own destination

This commit is contained in:
idk
2019-08-30 22:44:01 -04:00
parent a16a64c9e6
commit aa6e4e7b70

View File

@ -77,18 +77,19 @@ func DecodeIdentity(body *http.Request) (*http.Request, *Credentials, error) {
var creds Credentials
bb, err := ioutil.ReadAll(body.Body)
if err != nil {
return body, &creds, err
return nil, nil, err
}
req, err := http.NewRequest(body.Method, body.URL.String(), bytes.NewReader(bb))
if err != nil {
return req, &creds, err
return nil, nil, err
}
var ok bool
creds.User, creds.Site, ok = ProxyBasicAuth(body)
if ok {
log.Println("OK", creds.User, creds.Site)
}
creds.User += body.RemoteAddr
return req, &creds, nil
}