From 20e07c77ed63b351f32ecacb306a85e6428c83c4 Mon Sep 17 00:00:00 2001 From: Torsten Krause Date: Wed, 20 Nov 2024 11:06:26 +0100 Subject: [PATCH] MCR-3303 use Repr-Digest header instead of Digest header --- .../java/org/mycore/restapi/v2/MCRRestDerivateContents.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mycore-restapi/src/main/java/org/mycore/restapi/v2/MCRRestDerivateContents.java b/mycore-restapi/src/main/java/org/mycore/restapi/v2/MCRRestDerivateContents.java index ecf8736f81..046b4c9924 100644 --- a/mycore-restapi/src/main/java/org/mycore/restapi/v2/MCRRestDerivateContents.java +++ b/mycore-restapi/src/main/java/org/mycore/restapi/v2/MCRRestDerivateContents.java @@ -254,7 +254,7 @@ private static int getUploadMemThreshold() { */ private static String getDigestHeader(String md5sum) { final String md5Base64 = Base64.getEncoder().encodeToString(HexFormat.of().parseHex(md5sum)); - return "MD5=" + md5Base64; + return "md5=:" + md5Base64 + ":"; } @HEAD @@ -298,7 +298,7 @@ public Response getFileOrDirectoryMetadata() { .lastModified(Date.from(fileAttributes.lastModifiedTime().toInstant())) .header(HttpHeaders.CONTENT_LENGTH, fileAttributes.size()) .tag(getETag(fileAttributes)) - .header("Digest", getDigestHeader(fileAttributes.digest().toHexString())) + .header("Repr-Digest", getDigestHeader(fileAttributes.digest().toHexString())) .build(); } @@ -338,7 +338,7 @@ public Response getFileOrDirectory(@Context UriInfo uriInfo, @Context HttpHeader content.setMimeType(context.getMimeType(mcrPath.getFileName().toString())); try { final List> responseHeader = List - .of(Map.entry("Digest", getDigestHeader(fileAttributes.digest().toHexString()))); + .of(Map.entry("Repr-Digest", getDigestHeader(fileAttributes.digest().toHexString()))); return MCRRestContentHelper.serveContent(content, uriInfo, requestHeader, responseHeader); } catch (IOException e) { throw MCRErrorResponse.fromStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())