]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix host field in canonical headers under qs
authorJavier M. Mellid <jmunhoz@igalia.com>
Sat, 23 Jan 2016 20:46:51 +0000 (21:46 +0100)
committerJavier M. Mellid <jmunhoz@igalia.com>
Sat, 13 Feb 2016 12:53:05 +0000 (12:53 +0000)
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
src/rgw/rgw_rest_s3.cc

index 2ff9f4bb29aff0efd72db893c87b2599508373cd..e977166e47f8570a9d1a85909dcafe5147bb845a 100644 (file)
@@ -3157,6 +3157,7 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s)
   map<string, string> canonical_hdrs_map;
   istringstream sh(s->aws4_auth->signedheaders);
   string token;
+  string port = s->info.env->get("SERVER_PORT");
 
   while (getline(sh, token, ';')) {
     string token_env = "HTTP_" + token;
@@ -3182,6 +3183,8 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s)
       }
     }
     string token_value = string(t);
+    if (using_qs && (token == "host"))
+      token_value = token_value + ":" + port;
     canonical_hdrs_map[token] = rgw_trim_whitespace(token_value);
   }