diff options
author | B. Stack <bgstack15@gmail.com> | 2022-04-18 09:47:11 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-04-18 09:47:40 -0400 |
commit | b4b2e4a096fe8fe1ad530a4c181729be05834595 (patch) | |
tree | 84e67ca0a1fb045a12d015fcffca9cd8087c9332 /zen/http.cpp | |
parent | Merge branch 'b11.18' into 'master' (diff) | |
download | FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.tar.gz FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.tar.bz2 FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.zip |
add upstream 11.20
Diffstat (limited to 'zen/http.cpp')
-rw-r--r-- | zen/http.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zen/http.cpp b/zen/http.cpp index 24c5aa73..4fe43ede 100644 --- a/zen/http.cpp +++ b/zen/http.cpp @@ -144,7 +144,7 @@ public: statusCode_ = stringTo<int>(statusItems[1]); - for (const std::string& line : split(headersBuf, "\r\n", SplitOnEmpty::skip)) + for (const std::string& line : split(headersBuf, '\n', SplitOnEmpty::skip)) //careful: actual line separator is "\r\n"! responseHeaders_[trimCpy(beforeFirst(line, ':', IfNotFoundReturn::all))] = /**/ trimCpy(afterFirst (line, ':', IfNotFoundReturn::none)); @@ -344,7 +344,7 @@ bool zen::internetIsAlive() //noexcept { try { - auto response = std::make_unique<HttpInputStream::Impl>(Zstr("http://www.google.com/"), + auto response = std::make_unique<HttpInputStream::Impl>(Zstr("https://www.google.com/"), //https more appropriate than http for testing? (different ports!) nullptr /*postParams*/, "" /*contentType*/, true /*disableGetCache*/, @@ -353,7 +353,7 @@ bool zen::internetIsAlive() //noexcept nullptr /*notifyUnbufferedIO*/); //throw SysError const int statusCode = response->getStatusCode(); - //attention: http://www.google.com/ might redirect to "https" => don't follow, just return "true"!!! + //attention: google.com might redirect to https://consent.google.com => don't follow, just return "true"!!! return statusCode / 100 == 2 || //e.g. 200 statusCode / 100 == 3; //e.g. 301, 302, 303, 307... when in doubt, consider internet alive! } |