Skip to content

Commit f2dcd81

Browse files
committed
Fix that uploads would have 'aws-chunked' content encoding in files
1 parent 63f1b69 commit f2dcd81

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

webknossos-datastore/app/com/scalableminds/webknossos/datastore/datavault/Encoding.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ object Encoding extends ExtendedEnumeration {
1212
// List of possible entries: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
1313
def fromRfc7231String(s: String): Box[Encoding] =
1414
s match {
15-
case "gzip" => Full(gzip)
16-
case "x-gzip" => Full(gzip)
17-
case "br" => Full(brotli)
18-
case "identity" => Full(identity)
19-
case "" => Full(identity)
20-
case "aws-chunked" => Full(identity) // TODO: Does this work?
21-
case _ => Failure(s"Unsupported encoding: $s")
15+
case "gzip" => Full(gzip)
16+
case "x-gzip" => Full(gzip)
17+
case "br" => Full(brotli)
18+
case "identity" => Full(identity)
19+
case "" => Full(identity)
20+
case _ => Failure(s"Unsupported encoding: $s")
2221
}
2322
}

webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/uploading/UploadService.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import org.apache.commons.io.FileUtils
3232
import play.api.libs.json.{Json, OFormat, Reads}
3333
import software.amazon.awssdk.auth.credentials.{AwsBasicCredentials, StaticCredentialsProvider}
3434
import software.amazon.awssdk.core.async.AsyncRequestBody
35+
import software.amazon.awssdk.core.checksums.RequestChecksumCalculation
3536
import software.amazon.awssdk.regions.Region
3637
import software.amazon.awssdk.services.s3.S3AsyncClient
3738
import software.amazon.awssdk.services.s3.model.{
@@ -361,6 +362,7 @@ class UploadService @Inject()(dataSourceService: DataSourceService,
361362
.forcePathStyle(true)
362363
.endpointOverride(new URI(dataStoreConfig.Datastore.S3Upload.endpoint))
363364
.region(Region.US_EAST_1)
365+
.requestChecksumCalculation(RequestChecksumCalculation.WHEN_REQUIRED)
364366
.build()
365367

366368
def handleUploadChunkAws(

0 commit comments

Comments
 (0)