Skip to content

Commit

Permalink
set INTERNET_FLAG_SECURE for https in HttpGet (for sumatrapdfreader#3306
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kjk committed Feb 27, 2023
1 parent 7531354 commit 710f8c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/HttpUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ bool HttpGet(const char* urlA, HttpRsp* rspOut) {
WCHAR* url = ToWstrTemp(urlA);
DWORD flags = INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD;

if (str::StartsWithI(urlA, "https")) {
flags |= INTERNET_FLAG_SECURE;
}

rspOut->error = ERROR_SUCCESS;
HINTERNET hInet = InternetOpenW(kUserAgent, INTERNET_OPEN_TYPE_PRECONFIG, nullptr, nullptr, 0);
if (!hInet) {
Expand Down

0 comments on commit 710f8c1

Please sign in to comment.