jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Gaul <notificati...@github.com>
Subject Re: [jclouds] Set Content-MD5 only if ETag has correct format (#493)
Date Tue, 19 Aug 2014 20:13:23 GMT
> @@ -101,9 +102,9 @@ public void endElement(String uri, String name, String qName) {
>        } else if (qName.equals("ETag")) {
>           String currentETag = currentOrNull(currentText);
>           builder.eTag(currentETag);
> -         currentETag = currentETag.replace("\"", "");
> -         if (!MULTIPART_BLOB_ETAG.matcher(currentETag).matches()) {
> -            builder.contentMD5(base16().lowerCase().decode(currentETag));
> +         Matcher matcher = ETAG_CONTENT_MD5_PATTERN.matcher(currentETag);
> +         if (matcher.matches()) {

Previously this code explicitly rejected multi-part ETag "AAAA-1111", accepted single part
ETag "AAAA", and threw Exceptions on other forms.  Now it explicitly accepts single-part ETag
"AAAA" and ignores other forms.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/493/files#r16440271
Mime
View raw message