From: Bingyin Zhang Date: Thu, 30 Nov 2017 08:21:36 +0000 (+0800) Subject: rgw: remove the duplicated initialization of 'using_qs' in X-Git-Tag: v13.0.2~811^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d33a9b7acc2df906e3248e55f62a86c34d833502;p=ceph.git rgw: remove the duplicated initialization of 'using_qs' in parse_credentials Signed-off-by: Bingyin Zhang --- diff --git a/src/rgw/rgw_auth_s3.cc b/src/rgw/rgw_auth_s3.cc index ba137e3f59b5..1f89136a6264 100644 --- a/src/rgw/rgw_auth_s3.cc +++ b/src/rgw/rgw_auth_s3.cc @@ -417,13 +417,10 @@ int parse_credentials(const req_info& info, /* in */ boost::string_view& signedheaders, /* out */ boost::string_view& signature, /* out */ boost::string_view& date, /* out */ - bool& using_qs) /* out */ + const bool using_qs) /* in */ { - const char* const http_auth = info.env->get("HTTP_AUTHORIZATION"); - using_qs = http_auth == nullptr || http_auth[0] == '\0'; - - int ret; boost::string_view credential; + int ret; if (using_qs) { ret = parse_v4_query_string(info, credential, signedheaders, signature, date); diff --git a/src/rgw/rgw_auth_s3.h b/src/rgw/rgw_auth_s3.h index 1c851a933e11..c1abd6eb503b 100644 --- a/src/rgw/rgw_auth_s3.h +++ b/src/rgw/rgw_auth_s3.h @@ -344,7 +344,7 @@ int parse_credentials(const req_info& info, /* in */ boost::string_view& signedheaders, /* out */ boost::string_view& signature, /* out */ boost::string_view& date, /* out */ - bool& using_qs); /* out */ + const bool using_qs); /* in */ static inline std::string get_v4_canonical_uri(const req_info& info) { /* The code should normalize according to RFC 3986 but S3 does NOT do path diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index bc0c4ac18715..080c1180d92b 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -3724,8 +3724,7 @@ AWSGeneralAbstractor::get_v4_canonical_headers( AWSEngine::VersionAbstractor::auth_data_t AWSGeneralAbstractor::get_auth_data_v4(const req_state* const s, - /* FIXME: const. */ - bool using_qs) const + const bool using_qs) const { boost::string_view access_key_id; boost::string_view signed_hdrs; diff --git a/src/rgw/rgw_rest_s3.h b/src/rgw/rgw_rest_s3.h index d0aa098fa1b8..902ba6e36eb0 100644 --- a/src/rgw/rgw_rest_s3.h +++ b/src/rgw/rgw_rest_s3.h @@ -776,7 +776,7 @@ class AWSGeneralAbstractor : public AWSEngine::VersionAbstractor { const bool using_qs) const; auth_data_t get_auth_data_v2(const req_state* s) const; - auth_data_t get_auth_data_v4(const req_state* s, bool using_qs) const; + auth_data_t get_auth_data_v4(const req_state* s, const bool using_qs) const; public: AWSGeneralAbstractor(CephContext* const cct)