mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-23 00:34:23 +00:00
carddav: don't support PROPPATCH
PROPPATCH can't be used to change an address object's data. For now, let's not support it.
This commit is contained in:
parent
6de76c94b8
commit
bf97060e19
@ -247,6 +247,7 @@ func (b *backend) propfindAddressObject(propfind *internal.Propfind, ao *Address
|
|||||||
internal.GetContentTypeName: func(*internal.RawXMLValue) (interface{}, error) {
|
internal.GetContentTypeName: func(*internal.RawXMLValue) (interface{}, error) {
|
||||||
return &internal.GetContentType{Type: vcard.MIMEType}, nil
|
return &internal.GetContentType{Type: vcard.MIMEType}, nil
|
||||||
},
|
},
|
||||||
|
// TODO: address-data can only be used in REPORT requests
|
||||||
addressDataName: func(*internal.RawXMLValue) (interface{}, error) {
|
addressDataName: func(*internal.RawXMLValue) (interface{}, error) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
if err := vcard.NewEncoder(&buf).Encode(ao.Card); err != nil {
|
if err := vcard.NewEncoder(&buf).Encode(ao.Card); err != nil {
|
||||||
@ -262,7 +263,9 @@ func (b *backend) propfindAddressObject(propfind *internal.Propfind, ao *Address
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *backend) Proppatch(r *http.Request, update *internal.Propertyupdate) (*internal.Response, error) {
|
func (b *backend) Proppatch(r *http.Request, update *internal.Propertyupdate) (*internal.Response, error) {
|
||||||
panic("TODO")
|
// TODO: return a failed Response instead
|
||||||
|
// TODO: support PROPPATCH for address books
|
||||||
|
return nil, internal.HTTPErrorf(http.StatusForbidden, "carddav: PROPPATCH is unsupported")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *backend) Put(r *http.Request) error {
|
func (b *backend) Put(r *http.Request) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user