mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +00:00
internal: fix Error element definition
This commit is contained in:
parent
7cb302246b
commit
883dafaf41
@ -79,13 +79,13 @@ func (ms *Multistatus) Get(href string) (*Response, error) {
|
|||||||
|
|
||||||
// https://tools.ietf.org/html/rfc4918#section-14.24
|
// https://tools.ietf.org/html/rfc4918#section-14.24
|
||||||
type Response struct {
|
type Response struct {
|
||||||
XMLName xml.Name `xml:"DAV: response"`
|
XMLName xml.Name `xml:"DAV: response"`
|
||||||
Hrefs []string `xml:"href"`
|
Hrefs []string `xml:"href"`
|
||||||
Propstats []Propstat `xml:"propstat,omitempty"`
|
Propstats []Propstat `xml:"propstat,omitempty"`
|
||||||
ResponseDescription string `xml:"responsedescription,omitempty"`
|
ResponseDescription string `xml:"responsedescription,omitempty"`
|
||||||
Status *Status `xml:"status,omitempty"`
|
Status *Status `xml:"status,omitempty"`
|
||||||
Error *RawXMLValue `xml:"error,omitempty"`
|
Error *Error `xml:"error,omitempty"`
|
||||||
Location *Location `xml:"location,omitempty"`
|
Location *Location `xml:"location,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewOKResponse(href string) *Response {
|
func NewOKResponse(href string) *Response {
|
||||||
@ -158,11 +158,11 @@ type Location struct {
|
|||||||
|
|
||||||
// https://tools.ietf.org/html/rfc4918#section-14.22
|
// https://tools.ietf.org/html/rfc4918#section-14.22
|
||||||
type Propstat struct {
|
type Propstat struct {
|
||||||
XMLName xml.Name `xml:"DAV: propstat"`
|
XMLName xml.Name `xml:"DAV: propstat"`
|
||||||
Prop Prop `xml:"prop"`
|
Prop Prop `xml:"prop"`
|
||||||
Status Status `xml:"status"`
|
Status Status `xml:"status"`
|
||||||
ResponseDescription string `xml:"responsedescription,omitempty"`
|
ResponseDescription string `xml:"responsedescription,omitempty"`
|
||||||
Error *RawXMLValue `xml:"error,omitempty"`
|
Error *Error `xml:"error,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://tools.ietf.org/html/rfc4918#section-14.18
|
// https://tools.ietf.org/html/rfc4918#section-14.18
|
||||||
@ -264,3 +264,9 @@ type GetLastModified struct {
|
|||||||
XMLName xml.Name `xml:"DAV: getlastmodified"`
|
XMLName xml.Name `xml:"DAV: getlastmodified"`
|
||||||
LastModified Time `xml:",chardata"`
|
LastModified Time `xml:",chardata"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://tools.ietf.org/html/rfc4918#section-14.5
|
||||||
|
type Error struct {
|
||||||
|
XMLName xml.Name `xml:"DAV: error"`
|
||||||
|
Raw []RawXMLValue `xml:",any"`
|
||||||
|
}
|
||||||
|
@ -98,7 +98,6 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) error {
|
|||||||
|
|
||||||
depth := DepthInfinity
|
depth := DepthInfinity
|
||||||
if s := r.Header.Get("Depth"); s != "" {
|
if s := r.Header.Get("Depth"); s != "" {
|
||||||
var err error
|
|
||||||
depth, err = ParseDepth(s)
|
depth, err = ParseDepth(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &HTTPError{http.StatusBadRequest, err}
|
return &HTTPError{http.StatusBadRequest, err}
|
||||||
|
Loading…
Reference in New Issue
Block a user