Use address of www.wxwidgets.org instead of its name in HTTP URLs

The name resolves to Cloudflare proxy which redirects all HTTP URLs to
HTTPS, which breaks the existing tests using HTTP, so prevent this from
happening by using the actual IP address instead.
This commit is contained in:
Vadim Zeitlin
2022-04-23 18:03:25 +01:00
parent 9c4fe82242
commit da05a3770f
3 changed files with 6 additions and 4 deletions

View File

@@ -171,13 +171,14 @@ void ImageTestCase::LoadFromSocketStream()
return;
}
// These URLs use the real IP address of www.wxwidgets.org.
struct {
const char* url;
wxBitmapType type;
} testData[] =
{
{ "http://www.wxwidgets.org/assets/img/header-logo.png", wxBITMAP_TYPE_PNG },
{ "http://www.wxwidgets.org/assets/ico/favicon-1.ico", wxBITMAP_TYPE_ICO }
{ "http://173.254.92.22/assets/img/header-logo.png", wxBITMAP_TYPE_PNG },
{ "http://173.254.92.22/assets/ico/favicon-1.ico", wxBITMAP_TYPE_ICO }
};
for (unsigned int i=0; i<WXSIZEOF(testData); i++)

View File

@@ -436,7 +436,7 @@ static bool DoCheckConnection()
wxSocketBase::Initialize();
wxIPV4address addr;
if (!addr.Hostname(wxASCII_STR("www.wxwidgets.org")) || !addr.Service(wxASCII_STR("www")))
if (!addr.Hostname(0xadfe5c16) || !addr.Service(wxASCII_STR("www")))
{
wxSocketBase::Shutdown();
return false;

View File

@@ -69,7 +69,8 @@ void URLTestCase::GetInputStream()
return;
}
wxURL url("http://www.wxwidgets.org/assets/img/header-logo.png");
// This is the IP address of the real www.wxwidgets.org server.
wxURL url("http://173.254.92.22/assets/img/header-logo.png");
CPPUNIT_ASSERT_EQUAL(wxURL_NOERR, url.GetError());
wxScopedPtr<wxInputStream> in_stream(url.GetInputStream());