You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2024/11/20 19:53:41 UTC
(tomcat) branch 9.0.x updated: Add missing quotes for etag
This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 4cd94b70b3 Add missing quotes for etag
4cd94b70b3 is described below
commit 4cd94b70b30044d6d49ee18442db62fdd032455e
Author: remm <re...@apache.org>
AuthorDate: Wed Nov 20 20:51:12 2024 +0100
Add missing quotes for etag
---
java/org/apache/catalina/webresources/AbstractResource.java | 4 ++--
java/org/apache/catalina/webresources/CachedResource.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/catalina/webresources/AbstractResource.java b/java/org/apache/catalina/webresources/AbstractResource.java
index fccc3fb2e2..a606ca64b1 100644
--- a/java/org/apache/catalina/webresources/AbstractResource.java
+++ b/java/org/apache/catalina/webresources/AbstractResource.java
@@ -91,7 +91,7 @@ public abstract class AbstractResource implements WebResource {
byte[] buf = getContent();
if (buf != null) {
buf = ConcurrentMessageDigest.digest("SHA-1", buf);
- strongETag = HexUtils.toHexString(buf);
+ strongETag = "\"" + HexUtils.toHexString(buf) + "\"";
} else {
strongETag = getETag();
}
@@ -106,7 +106,7 @@ public abstract class AbstractResource implements WebResource {
}
digest.update(buf, 0, n);
}
- strongETag = HexUtils.toHexString(digest.digest());
+ strongETag = "\"" + HexUtils.toHexString(digest.digest()) + "\"";
} catch (Exception e) {
strongETag = getETag();
}
diff --git a/java/org/apache/catalina/webresources/CachedResource.java b/java/org/apache/catalina/webresources/CachedResource.java
index 83510f9d98..40fb323224 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -300,7 +300,7 @@ public class CachedResource implements WebResource {
byte[] buf = getContent();
if (buf != null) {
buf = ConcurrentMessageDigest.digest("SHA-1", buf);
- cachedStrongETag = HexUtils.toHexString(buf);
+ cachedStrongETag = "\"" + HexUtils.toHexString(buf) + "\"";
} else {
cachedStrongETag = webResource.getStrongETag();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org