std::string get_v4_canonical_qs(const req_info& info, const bool using_qs)
{
- if (info.request_params.empty()) {
+ const std::string *params = &info.request_params;
+ std::string copy_params;
+ if (params->empty()) {
/* Optimize the typical flow. */
return std::string();
}
+ if (params->find_first_of('+') != std::string::npos) {
+ copy_params = *params;
+ boost::replace_all(copy_params, "+", " ");
+ params = ©_params;
+ }
/* Handle case when query string exists. Step 3 described in: http://docs.
* aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html */
std::map<std::string, std::string> canonical_qs_map;
- for (const auto& s : get_str_vec<5>(info.request_params, "&")) {
+ for (const auto& s : get_str_vec<5>(*params, "&")) {
boost::string_view key, val;
const auto parsed_pair = parse_key_value(s);
if (parsed_pair) {