internal: no status element in propstat responses

Responses that contain propstat elements do not contain their own
top-level status element, only the status elements inside the propstat
element.

See https://datatracker.ietf.org/doc/html/rfc4918#section-14.24 or any
of the examples for PROPFIND/PROPPATCH, starting e.g. here:
https://datatracker.ietf.org/doc/html/rfc4918#section-9.1.3
This commit is contained in:
Conrad Hoffmann 2024-02-08 22:36:58 +01:00 committed by Simon Ser
parent ad1fe1c5a8
commit 25f1014ef2

View File

@ -173,7 +173,7 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) error {
type PropFindFunc func(raw *RawXMLValue) (interface{}, error) type PropFindFunc func(raw *RawXMLValue) (interface{}, error)
func NewPropFindResponse(path string, propfind *PropFind, props map[xml.Name]PropFindFunc) (*Response, error) { func NewPropFindResponse(path string, propfind *PropFind, props map[xml.Name]PropFindFunc) (*Response, error) {
resp := NewOKResponse(path) resp := &Response{Hrefs: []Href{Href{Path: path}}}
if _, ok := props[ResourceTypeName]; !ok { if _, ok := props[ResourceTypeName]; !ok {
props[ResourceTypeName] = func(*RawXMLValue) (interface{}, error) { props[ResourceTypeName] = func(*RawXMLValue) (interface{}, error) {