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

This commit is contained in:
Nick Craig-Wood 2020-01-11 17:22:06 +00:00
parent ede36b001b
commit e4d2d228bd

View File

@ -358,6 +358,7 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
f.srv.SetHeader("Referer", u.String())
if root != "" && !rootIsDir { if root != "" && !rootIsDir {
// Check to see if the root actually an existing file // Check to see if the root actually an existing file