When objects are restored from a cloud endpoint, the ETag value read
from the HTTP response includes surrounding double-quotes per RFC 7232.
RGW stores ETags unquoted internally, and dump_etag() adds its own
quotes when serving responses. The mismatch results in double-quoted
ETags like ""abc123-6"" on restored objects.
Strip the quotes from both the etag output parameter and the
RGW_ATTR_ETAG attribute after fetching from the cloud endpoint,
matching the unquoted format RGW uses everywhere else.
Signed-off-by: Matthew N. Heler <matthew.heler@hotmail.com>
}
}
+ /*
+ * The HTTP ETag header value is a quoted-string per RFC 7232.
+ * Strip the surrounding quotes so we do not double quote them.
+ */
+ etag = rgw_string_unquote(etag);
+
+ if (auto i = attrs.find(RGW_ATTR_ETAG); i != attrs.end()) {
+ const string unquoted = rgw_string_unquote(i->second.to_str());
+ bufferlist bl;
+ bl.append(unquoted);
+ i->second = std::move(bl);
+ }
+
ldpp_dout(tier_ctx.dpp, 20) << __func__ << "(): Successfully fetched object from cloud bucket:" << dest_bucket << ", object: " << target_obj_name << dendl;
return ret;
}