mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-22 11:09:02 -05:00
return 425 on thumbnails when file is processing
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -245,6 +245,10 @@ func (g Webdav) SpacesThumbnail(w http.ResponseWriter, r *http.Request) {
|
||||
// StatusNotFound is expected for unsupported files
|
||||
renderError(w, r, errNotFound(notFoundMsg(tr.Filename)))
|
||||
return
|
||||
case http.StatusTooEarly:
|
||||
// StatusTooEarly if file is processing
|
||||
renderError(w, r, errTooEarly(err.Error()))
|
||||
return
|
||||
case http.StatusBadRequest:
|
||||
renderError(w, r, errBadRequest(err.Error()))
|
||||
default:
|
||||
@@ -508,6 +512,10 @@ func errNotFound(msg string) *errResponse {
|
||||
return newErrResponse(http.StatusNotFound, msg)
|
||||
}
|
||||
|
||||
func errTooEarly(msg string) *errResponse {
|
||||
return newErrResponse(http.StatusTooEarly, msg)
|
||||
}
|
||||
|
||||
func renderError(w http.ResponseWriter, r *http.Request, err *errResponse) {
|
||||
render.Status(r, err.HTTPStatusCode)
|
||||
render.XML(w, r, err)
|
||||
|
||||
Reference in New Issue
Block a user