From 2db937c0a7b7eaee4d451862bddb9deda4e01b04 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Sun, 14 Jun 2020 08:40:54 +0000 Subject: [PATCH] Clarify that we don't support HTTPS (yet) wxHTTP supports only the very basic HTTP protocol. We'd need to write a complete new wxProtocol handler for HTTPS - which we seem to need to do anyway, it's already 2020 and almost every site uses https. --- .svn-revision | 2 +- src/HTTPDownload.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.svn-revision b/.svn-revision index 14b6f447..814b3586 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -11046 +11047 diff --git a/src/HTTPDownload.cpp b/src/HTTPDownload.cpp index b92b6867..11df0565 100644 --- a/src/HTTPDownload.cpp +++ b/src/HTTPDownload.cpp @@ -329,13 +329,16 @@ void CHTTPDownloadThread::OnExit() //! This function's purpose is to handle redirections in a proper way. wxInputStream* CHTTPDownloadThread::GetInputStream(wxHTTP * & url_handler, const wxString& location, bool proxy) { + // Extract the protocol name + wxString protocol(location.BeforeFirst(wxT(':'))); + if (TestDestroy()) { return NULL; } - if (!location.StartsWith(wxT("http://"))) { + if (protocol != wxT("http")) { // This is not a http url - throw wxString(_("Invalid URL for HTTP download or HTTP redirection (did you forget 'http://' ?)")); + throw wxString(CFormat(_("Protocol not supported for HTTP download: %s")) % protocol); } // Get the host @@ -411,6 +414,7 @@ wxInputStream* CHTTPDownloadThread::GetInputStream(wxHTTP * & url_handler, const delete url_read_stream; wxString new_location = url_handler->GetHeader(wxT("Location")); + AddDebugLogLineN(logHTTP, CFormat(wxT("Redirecting to: %s")) % new_location); url_handler->Destroy(); if (!new_location.IsEmpty()) { -- 2.11.4.GIT