mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-06 23:23:18 -04:00
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:
6
changelog/unreleased/fix-too-early-preview-request.md
Normal file
6
changelog/unreleased/fix-too-early-preview-request.md
Normal 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
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user