diff --git a/changelog/unreleased/fix-425-get.md b/changelog/unreleased/fix-425-get.md new file mode 100644 index 0000000000..90291cb6ff --- /dev/null +++ b/changelog/unreleased/fix-425-get.md @@ -0,0 +1,5 @@ +Bugfix: Return 425 on GET + +On ocdav GET endpoint the server will now return `425` instead `500` when the file is being processed + +https://github.com/cs3org/reva/pull/3688 diff --git a/internal/http/services/owncloud/ocdav/get.go b/internal/http/services/owncloud/ocdav/get.go index eb523b36f3..1be7021851 100644 --- a/internal/http/services/owncloud/ocdav/get.go +++ b/internal/http/services/owncloud/ocdav/get.go @@ -33,6 +33,7 @@ import ( "github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/spacelookup" "github.com/cs3org/reva/v2/pkg/appctx" "github.com/cs3org/reva/v2/pkg/rhttp" + "github.com/cs3org/reva/v2/pkg/utils" "github.com/rs/zerolog" ) @@ -78,6 +79,11 @@ func (s *svc) handleGet(ctx context.Context, w http.ResponseWriter, r *http.Requ return } + if status := utils.ReadPlainFromOpaque(sRes.GetInfo().GetOpaque(), "status"); status == "processing" { + w.WriteHeader(http.StatusTooEarly) + return + } + dReq := &provider.InitiateFileDownloadRequest{Ref: ref} dRes, err := s.gwClient.InitiateFileDownload(ctx, dReq) switch {