Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

webdav: add Referer header to fix problems with WAFs - fixes #3868

Nick Craig-Woode4d2d228bd3a
diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go
index 4a21ea05f..4c8d2ba53 100644
--- a/backend/webdav/webdav.go
+++ b/backend/webdav/webdav.go
@@ -358,6 +358,7 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) {
if err != nil {
return nil, err
}
+ f.srv.SetHeader("Referer", u.String())
if root != "" && !rootIsDir {
// Check to see if the root actually an existing file