]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fix s3 aws v2 signature priority between header['X-Amz-Date'] and header['Date'] 15467/head
authoryuliyang <yuliyang@cmss.chinamobile.com>
Sun, 4 Jun 2017 11:06:27 +0000 (19:06 +0800)
committeryuliyang <yuliyang@yuliyangdembp.lan>
Sat, 24 Jun 2017 08:27:09 +0000 (16:27 +0800)
fix http://tracker.ceph.com/issues/20176

Signed-off-by: yuliyang <yuliyang@cmss.chinamobile.com>
src/rgw/rgw_auth_s3.cc

index 0788974635df73ed8c4cc9a2e0b8b20ba57fe8d4..692c915189b87cff38c8ea75d03bd41d3ae3cbc1 100644 (file)
@@ -178,16 +178,15 @@ bool rgw_create_s3_canonical_header(const req_info& info,
   if (qsr) {
     date = info.args.get("Expires");
   } else {
-    const char *str = info.env->get("HTTP_DATE");
+    const char *str = info.env->get("HTTP_X_AMZ_DATE");
     const char *req_date = str;
-    if (str) {
-      date = str;
-    } else {
-      req_date = info.env->get("HTTP_X_AMZ_DATE");
+    if (str == NULL) {
+      req_date = info.env->get("HTTP_DATE");
       if (!req_date) {
         dout(0) << "NOTICE: missing date for auth header" << dendl;
         return false;
       }
+      date = req_date;
     }
 
     if (header_time) {