summaryrefslogtreecommitdiff
path: root/zen/http.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-04-18 13:48:31 +0000
committerB. Stack <bgstack15@gmail.com>2022-04-18 13:48:31 +0000
commit8a551d2eff24bdd23bc25caeb8d17207409aae38 (patch)
tree84e67ca0a1fb045a12d015fcffca9cd8087c9332 /zen/http.cpp
parentMerge branch 'b11.18' into 'master' (diff)
parentadd upstream 11.20 (diff)
downloadFreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.tar.gz
FreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.tar.bz2
FreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.zip
Merge branch 'b11.20' into 'master'11.20
add upstream 11.20 See merge request opensource-tracking/FreeFileSync!43
Diffstat (limited to 'zen/http.cpp')
-rw-r--r--zen/http.cpp6
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!
}
bgstack15