Skip to content

Commit 7d93aa8

Browse files
authored
Merge pull request ceph#51983 from clwluvw/aws4-date-header
rgw: pick http_date in case of http_x_amz_date absence Reviewed-by: Matt Benjamin <[email protected]>
2 parents c42efbf + 912b774 commit 7d93aa8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rgw/rgw_auth_s3.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,11 @@ static inline int parse_v4_auth_header(const req_info& info, /* in
436436
const char *d = info.env->get("HTTP_X_AMZ_DATE");
437437

438438
struct tm t;
439+
if (unlikely(d == NULL)) {
440+
d = info.env->get("HTTP_DATE");
441+
}
439442
if (!d || !parse_iso8601(d, &t, NULL, false)) {
440-
ldpp_dout(dpp, 10) << "error reading date via http_x_amz_date" << dendl;
443+
ldpp_dout(dpp, 10) << "error reading date via http_x_amz_date and http_date" << dendl;
441444
return -EACCES;
442445
}
443446
date = d;

0 commit comments

Comments
 (0)