Skip to content

Commit

Permalink
Merge pull request #51983 from clwluvw/aws4-date-header
Browse files Browse the repository at this point in the history
rgw: pick http_date in case of http_x_amz_date absence

Reviewed-by: Matt Benjamin <[email protected]>
  • Loading branch information
ivancich authored Jul 2, 2023
2 parents c42efbf + 912b774 commit 7d93aa8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rgw/rgw_auth_s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,11 @@ static inline int parse_v4_auth_header(const req_info& info, /* in
const char *d = info.env->get("HTTP_X_AMZ_DATE");

struct tm t;
if (unlikely(d == NULL)) {
d = info.env->get("HTTP_DATE");
}
if (!d || !parse_iso8601(d, &t, NULL, false)) {
ldpp_dout(dpp, 10) << "error reading date via http_x_amz_date" << dendl;
ldpp_dout(dpp, 10) << "error reading date via http_x_amz_date and http_date" << dendl;
return -EACCES;
}
date = d;
Expand Down

0 comments on commit 7d93aa8

Please sign in to comment.