s3cmd encodes space as "%20" while signature computation and
encodes space as '+' while sending the canonical uri. This
results in a SignatureMismatch Error in rgw, since rgw
computes the signature based on the request received from
the client (s3cmd in this case).
Fixes http://tracker.ceph.com/issues/17076.
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
#include "common/ceph_json.h"
#include "common/safe_io.h"
#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/replace.hpp>
#include "rgw_rest.h"
#include "rgw_rest_s3.h"
if (s->aws4_auth->canonical_uri.empty()) {
s->aws4_auth->canonical_uri = "/";
+ } else {
+ boost::replace_all(s->aws4_auth->canonical_uri, "+", "%20");
}
/* craft canonical query string */