forked from organicmaps/organicmaps
[android][ios][traffic] Fixed 'etag' header processing
This commit is contained in:
parent
2497be5ebb
commit
ea499b414c
4 changed files with 9 additions and 4 deletions
|
@ -154,7 +154,7 @@ public final class HttpClient
|
|||
if (header.getKey() == null || header.getValue() == null)
|
||||
continue;
|
||||
|
||||
p.headers.add(new HttpHeader(header.getKey(), TextUtils.join(", ", header.getValue())));
|
||||
p.headers.add(new HttpHeader(header.getKey().toLowerCase(), TextUtils.join(", ", header.getValue())));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -110,7 +110,7 @@ bool HttpClient::RunHttpRequest()
|
|||
{
|
||||
[response.allHeaderFields enumerateKeysAndObjectsUsingBlock:^(NSString * key, NSString * obj, BOOL * stop)
|
||||
{
|
||||
m_headers.emplace(key.UTF8String, obj.UTF8String);
|
||||
m_headers.emplace(key.lowercaseString.UTF8String, obj.UTF8String);
|
||||
}];
|
||||
}
|
||||
else
|
||||
|
|
|
@ -208,6 +208,7 @@ bool HttpClient::RunHttpRequest()
|
|||
m_headers.clear();
|
||||
Headers const headers = ParseHeaders(ReadFileAsString(headers_deleter.m_fileName));
|
||||
string serverCookies;
|
||||
string headerKey;
|
||||
for (auto const & header : headers)
|
||||
{
|
||||
if (header.first == "Set-Cookie")
|
||||
|
@ -220,7 +221,11 @@ bool HttpClient::RunHttpRequest()
|
|||
m_urlReceived = header.second;
|
||||
|
||||
if (m_loadHeaders)
|
||||
m_headers.emplace(header.first, header.second);
|
||||
{
|
||||
headerKey = header.first;
|
||||
strings::AsciiToLower(headerKey);
|
||||
m_headers.emplace(headerKey, header.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_headers.emplace("Set-Cookie", NormalizeServerCookies(move(serverCookies)));
|
||||
|
|
|
@ -76,7 +76,7 @@ string MakeRemoteURL(string const & name, uint64_t version)
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
char const kETag[] = "Etag";
|
||||
char const kETag[] = "etag";
|
||||
} // namespace
|
||||
|
||||
// TrafficInfo::RoadSegmentId -----------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Reference in a new issue