mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 08:14:15 +00:00
carddav: use partial error response on multiget failure
Instead of making the whole HTTP request fail when a single address object cannot be fetched, return a partial error response.
This commit is contained in:
parent
46ebe58ac2
commit
8cc6542f1c
@ -205,7 +205,9 @@ func (h *Handler) handleMultiget(ctx context.Context, w http.ResponseWriter, mul
|
|||||||
for _, href := range multiget.Hrefs {
|
for _, href := range multiget.Hrefs {
|
||||||
ao, err := h.Backend.GetAddressObject(ctx, href.Path, &dataReq)
|
ao, err := h.Backend.GetAddressObject(ctx, href.Path, &dataReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err // TODO: create internal.Response with error
|
resp := internal.NewErrorResponse(href.Path, err)
|
||||||
|
resps = append(resps, *resp)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
b := backend{h.Backend}
|
b := backend{h.Backend}
|
||||||
|
Loading…
Reference in New Issue
Block a user