From d999215da21ca6e9033cdcf9ba3450075b0de32d Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 7 Aug 2024 15:34:52 +0200 Subject: [PATCH] Return a 400 when the file content length header is missing (#5081) Co-authored-by: Simon Dumas --- .../nexus/delta/plugins/storage/files/model/FileRejection.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/model/FileRejection.scala b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/model/FileRejection.scala index 7ef4974ccf..4d2c232e5f 100644 --- a/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/model/FileRejection.scala +++ b/delta/plugins/storage/src/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/model/FileRejection.scala @@ -281,6 +281,7 @@ object FileRejection { case FetchRejection(_, _, FetchFileRejection.FileNotFound(_)) => (StatusCodes.InternalServerError, Seq.empty) case SaveRejection(_, _, SaveFileRejection.ResourceAlreadyExists(_)) => (StatusCodes.Conflict, Seq.empty) case SaveRejection(_, _, SaveFileRejection.BucketAccessDenied(_, _, _)) => (StatusCodes.Forbidden, Seq.empty) + case SaveRejection(_, _, SaveFileRejection.FileContentLengthIsMissing) => (StatusCodes.BadRequest, Seq.empty) case CopyRejection(_, _, _, rejection) => (rejection.status, Seq.empty) case FetchRejection(_, _, _) => (StatusCodes.InternalServerError, Seq.empty) case SaveRejection(_, _, _) => (StatusCodes.InternalServerError, Seq.empty)