Skip to content

Commit

Permalink
Revert "rgw: use camelcase format to specify field name in request he…
Browse files Browse the repository at this point in the history
…ader"

This reverts commit c6595c9.
  • Loading branch information
Leeshine committed Nov 29, 2017
1 parent 0136899 commit 1e095c3
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/rgw/rgw_http_client.cc
Expand Up @@ -238,37 +238,6 @@ void RGWHTTPClient::_set_read_paused(bool pause)
}
}

/*
* make attrs Look-Like-This
* converts underscores to dashes
*/
static string camelcase_dash_http_attr(const string& orig)
{
const char *s = orig.c_str();
char buf[orig.size() + 1];
buf[orig.size()] = '\0';

bool last_sep = true;

for (size_t i = 0; i < orig.size(); ++i, ++s) {
switch (*s) {
case '_':
case '-':
buf[i] = '-';
last_sep = true;
break;
default:
if (last_sep) {
buf[i] = toupper(*s);
} else {
buf[i] = tolower(*s);
}
last_sep = false;
}
}
return string(buf);
}

static curl_slist *headers_to_slist(param_vec_t& headers)
{
curl_slist *h = NULL;
Expand All @@ -282,8 +251,6 @@ static curl_slist *headers_to_slist(param_vec_t& headers)
val = val.substr(5);
}

val = camelcase_dash_http_attr(val);

/* we need to convert all underscores into dashes as some web servers forbid them
* in the http header field names
*/
Expand Down

0 comments on commit 1e095c3

Please sign in to comment.