mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
Map HTTP 403 error correctly.
Signed-off-by: Christian Richter <crichter@owncloud.com> Co-authored-by: Julian Koberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -354,6 +354,8 @@ func (g Webdav) Thumbnail(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
case http.StatusBadRequest:
|
||||
renderError(w, r, errBadRequest(e.Detail))
|
||||
case http.StatusForbidden:
|
||||
renderError(w, r, errPermissionDenied(e.Detail))
|
||||
default:
|
||||
renderError(w, r, errInternalError(err.Error()))
|
||||
}
|
||||
@@ -531,6 +533,10 @@ func errBadRequest(msg string) *errResponse {
|
||||
return newErrResponse(http.StatusBadRequest, msg)
|
||||
}
|
||||
|
||||
func errPermissionDenied(msg string) *errResponse {
|
||||
return newErrResponse(http.StatusForbidden, msg)
|
||||
}
|
||||
|
||||
func errNotFound(msg string) *errResponse {
|
||||
return newErrResponse(http.StatusNotFound, msg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user