ipn/ipnlocal: strip origin and referer headers from Taildrive requests

peerapi does not want these, but rclone includes them.
Stripping them out allows rclone to work with Taildrive configured
as a WebDAV remote.

Updates #cleanup

Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
Percy Wegmann 2024-04-16 08:12:47 -05:00 committed by Percy Wegmann
parent 787f8c08ec
commit 94c0403104
1 changed files with 4 additions and 0 deletions

View File

@ -4833,6 +4833,10 @@ func (dt *driveTransport) RoundTrip(req *http.Request) (resp *http.Response, err
req.Body = bw
}
// Strip origin and referer headers
req.Header.Del("origin")
req.Header.Del("referer")
defer func() {
contentType := "unknown"
switch req.Method {