<rdar://problem/9567286> and https://bugs.webkit.org/show_bug.cgi?id=78003 WebKit associates credentials with the wrong site if the authentication challenge takes place after a redirect chain
Reviewed by Alexey Proskuryakov.
Source/WebCore:
Test: http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials.html
Associate the credential with the URL of the challenge itself, not the original request:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
LayoutTests:
* http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials-expected.txt: Added.
* http/tests/loading/authentication-after-redirect-stores-wrong-credentials/authentication-after-redirect-stores-wrong-credentials.html: Added.
* http/tests/loading/authentication-after-redirect-stores-wrong-credentials/resources/wrong-credential-1-redirect-to-auth.php: Added.
* http/tests/loading/authentication-after-redirect-stores-wrong-credentials/resources/wrong-credential-2-auth-then-redirect-to-finish.php: Added.
* http/tests/loading/authentication-after-redirect-stores-wrong-credentials/resources/wrong-credential-3-output-credentials-then-finish.php: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106982
268f45cc-cd09-0410-ab3c-
d52691b4dbfc