\r\n won't be passed in libcurl response header callback
This commit is contained in:
Родитель
18b482a934
Коммит
b674a1096a
|
@ -277,8 +277,8 @@ std::future<storage_outcome<blob_property>> blob_client::get_blob_properties(con
|
|||
{
|
||||
if (iter->first.find("x-ms-meta-") == 0)
|
||||
{
|
||||
// We need to strip ten characters from the front of the key to account for "x-ms-meta-", and two characters from the end of the value, to account for the "\r\n".
|
||||
properties.metadata.push_back(std::make_pair(iter->first.substr(10), iter->second.substr(0, iter->second.size() - 2)));
|
||||
// We need to strip ten characters from the front of the key to account for "x-ms-meta-".
|
||||
properties.metadata.push_back(std::make_pair(iter->first.substr(10), iter->second));
|
||||
}
|
||||
}
|
||||
return storage_outcome<blob_property>(properties);
|
||||
|
|
|
@ -71,6 +71,14 @@ namespace azure { namespace storage_lite {
|
|||
{
|
||||
CurlEasyRequest::REQUEST_TYPE *p = static_cast<CurlEasyRequest::REQUEST_TYPE *>(userdata);
|
||||
std::string header(buffer, size * nitems);
|
||||
if (!header.empty() && header.back() == '\n')
|
||||
{
|
||||
header.pop_back();
|
||||
}
|
||||
if (!header.empty() && header.back() == '\r')
|
||||
{
|
||||
header.pop_back();
|
||||
}
|
||||
auto colon = header.find(':');
|
||||
if (colon == std::string::npos) {
|
||||
auto space = header.find(' ');
|
||||
|
|
Загрузка…
Ссылка в новой задаче