fix: request to preview gives 500 error for old/new webdav if file is in processing (#7507)

* fix: request to preview gives 500 error for old/new webdav if file is in processing

* add changelog
This commit is contained in:
Sawjan Gurung
2023-10-17 14:53:47 +05:45
committed by GitHub
parent 11afd503cf
commit c0594d6f80
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
Bugfix: Fix preview request 500 error when made too early
Fix the status code and message when a thumbnail request is made too early.
https://github.com/owncloud/ocis/issues/7502
https://github.com/owncloud/ocis/pull/7507

View File

@@ -260,7 +260,7 @@ func (g Webdav) SpacesThumbnail(w http.ResponseWriter, r *http.Request) {
return
case http.StatusTooEarly:
// StatusTooEarly if file is processing
renderError(w, r, errTooEarly(err.Error()))
renderError(w, r, errTooEarly(e.Detail))
return
case http.StatusBadRequest:
renderError(w, r, errBadRequest(e.Detail))
@@ -351,6 +351,10 @@ func (g Webdav) Thumbnail(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(e.Detail))
return
case http.StatusBadRequest:
renderError(w, r, errBadRequest(e.Detail))
default: