Modified: trunk/Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp (273378 => 273379)
--- trunk/Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp 2021-02-24 10:57:33 UTC (rev 273378)
+++ trunk/Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp 2021-02-24 11:43:22 UTC (rev 273379)
@@ -61,7 +61,16 @@
else
scheme = ProtectionSpaceAuthenticationSchemeUnknown;
- return ProtectionSpace(url.host().toString(), static_cast<int>(url.port().valueOr(0)),
+#if USE(SOUP2)
+ auto host = url.host();
+ auto port = url.port();
+#else
+ URL authURL({ }, makeString("http://", soup_auth_get_authority(soupAuth)));
+ auto host = authURL.host();
+ auto port = authURL.port();
+#endif
+
+ return ProtectionSpace(host.toString(), static_cast<int>(port.valueOr(0)),
protectionSpaceServerTypeFromURL(url, soup_auth_is_for_proxy(soupAuth)),
String::fromUTF8(soup_auth_get_realm(soupAuth)), scheme);
}
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp (273378 => 273379)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp 2021-02-24 10:57:33 UTC (rev 273378)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp 2021-02-24 11:43:22 UTC (rev 273379)
@@ -490,9 +490,14 @@
{
test->loadURI(kServer->getURIForPath("/proxy/auth-test.html").data());
WebKitAuthenticationRequest* request = test->waitForAuthenticationRequest();
+#if USE(SOUP2)
// FIXME: the uri and host should the proxy ones, not the requested ones.
ASSERT_CMP_CSTRING(webkit_authentication_request_get_host(request), ==, kServer->baseURL().host().toString().utf8());
g_assert_cmpuint(webkit_authentication_request_get_port(request), ==, kServer->port());
+#else
+ ASSERT_CMP_CSTRING(webkit_authentication_request_get_host(request), ==, test->m_proxyServer.baseURL().host().toString().utf8());
+ g_assert_cmpuint(webkit_authentication_request_get_port(request), ==, test->m_proxyServer.port());
+#endif
g_assert_cmpstr(webkit_authentication_request_get_realm(request), ==, "Proxy realm");
g_assert_cmpint(webkit_authentication_request_get_scheme(request), ==, WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC);
g_assert_true(webkit_authentication_request_is_for_proxy(request));
@@ -500,8 +505,13 @@
auto* origin = webkit_authentication_request_get_security_origin(request);
g_assert_nonnull(origin);
ASSERT_CMP_CSTRING(webkit_security_origin_get_protocol(origin), ==, kServer->baseURL().protocol().toString().utf8());
+#if USE(SOUP2)
ASSERT_CMP_CSTRING(webkit_security_origin_get_host(origin), ==, kServer->baseURL().host().toString().utf8());
g_assert_cmpuint(webkit_security_origin_get_port(origin), ==, kServer->port());
+#else
+ ASSERT_CMP_CSTRING(webkit_security_origin_get_host(origin), ==, test->m_proxyServer.baseURL().host().toString().utf8());
+ g_assert_cmpuint(webkit_security_origin_get_port(origin), ==, test->m_proxyServer.port());
+#endif
webkit_security_origin_unref(origin);
}
@@ -512,9 +522,14 @@
test->loadURI(httpsServer->getURIForPath("/proxy/auth-test.html").data());
WebKitAuthenticationRequest* request = test->waitForAuthenticationRequest();
+#if USE(SOUP2)
// FIXME: the uri and host should the proxy ones, not the requested ones.
ASSERT_CMP_CSTRING(webkit_authentication_request_get_host(request), ==, httpsServer->baseURL().host().toString().utf8());
g_assert_cmpuint(webkit_authentication_request_get_port(request), ==, httpsServer->port());
+#else
+ ASSERT_CMP_CSTRING(webkit_authentication_request_get_host(request), ==, test->m_proxyServer.baseURL().host().toString().utf8());
+ g_assert_cmpuint(webkit_authentication_request_get_port(request), ==, test->m_proxyServer.port());
+#endif
g_assert_cmpstr(webkit_authentication_request_get_realm(request), ==, "Proxy realm");
g_assert_cmpint(webkit_authentication_request_get_scheme(request), ==, WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC);
g_assert_true(webkit_authentication_request_is_for_proxy(request));
@@ -522,8 +537,13 @@
auto* origin = webkit_authentication_request_get_security_origin(request);
g_assert_nonnull(origin);
ASSERT_CMP_CSTRING(webkit_security_origin_get_protocol(origin), ==, httpsServer->baseURL().protocol().toString().utf8());
+#if USE(SOUP2)
ASSERT_CMP_CSTRING(webkit_security_origin_get_host(origin), ==, httpsServer->baseURL().host().toString().utf8());
g_assert_cmpuint(webkit_security_origin_get_port(origin), ==, httpsServer->port());
+#else
+ ASSERT_CMP_CSTRING(webkit_security_origin_get_host(origin), ==, test->m_proxyServer.baseURL().host().toString().utf8());
+ g_assert_cmpuint(webkit_security_origin_get_port(origin), ==, test->m_proxyServer.port());
+#endif
webkit_security_origin_unref(origin);
}