webdav: fix URL encoding in PROPFIND handler

This commit is contained in:
Simon Ser 2020-01-21 21:02:41 +01:00
parent 0469c3d389
commit ffc628aed9
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -7,6 +7,7 @@ import (
"net/http"
"os"
"path"
"net/url"
"github.com/emersion/go-webdav/internal"
)
@ -157,6 +158,6 @@ func (b *backend) propfindFile(propfind *internal.Propfind, name string, fi os.F
// TODO: getetag
}
href := url.URL{Path: name}.String()
return internal.NewPropfindResponse(href, propfind, props)
u := url.URL{Path: name}
return internal.NewPropfindResponse(u.String(), propfind, props)
}