Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/DefaultWebRequestWinInet.cpp

Issue 11588009: Support of gzip, deflate added to WinInet web request implementation (Closed)
Patch Set: Created Sept. 3, 2013, 11:44 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/DefaultWebRequestWinInet.cpp
===================================================================
--- a/src/DefaultWebRequestWinInet.cpp
+++ b/src/DefaultWebRequestWinInet.cpp
@@ -283,7 +283,13 @@
result.status = WindowsErrorToGeckoError(GetLastError());
return result;
}
- // TODO: Make sure for HTTP 1.1 "Accept-Encoding: gzip, deflate" doesn't HAVE to be set here
+ HTTP_VERSION_INFO ver;
+ DWORD l = sizeof(ver);
+ WinHttpQueryOption(NULL, WINHTTP_OPTION_HTTP_VERSION, (void*)&ver, &l);
Wladimir Palant 2013/09/04 07:21:25 Nit: explicit conversion to void* is unnecessary I
+ if (ver.dwMinorVersion == 1)
Oleksandr 2013/09/03 11:49:41 No compression for IE6 (HTTP 1.0)
Wladimir Palant 2013/09/04 07:21:25 I don't like hardcoding the expectation here that
+ {
+ headers += L"Accept-Encoding: gzip, deflate\r\n";
+ }
if (headers.length() > 0)
{
res = ::WinHttpSendRequest(hRequest, headers.c_str(), headers.length(), WINHTTP_NO_REQUEST_DATA, 0, 0, 0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld