[Curl] Fix issue that extra cookie is added when redirect happens.
authorBasuke.Suzuki@sony.com <Basuke.Suzuki@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Aug 2018 20:50:19 +0000 (20:50 +0000)
committerBasuke.Suzuki@sony.com <Basuke.Suzuki@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Aug 2018 20:50:19 +0000 (20:50 +0000)
commit84c0830d079e831b34ebfe658041d3328276fdd3
tree438ae5794256f7f1e035e57f76fa41de2aa905c1
parent596185babfb1a4261cd5e8099bd5fc49ead9053e
[Curl] Fix issue that extra cookie is added when redirect happens.
https://bugs.webkit.org/show_bug.cgi?id=187874

Reviewed by Alex Christensen.

Source/WebCore:

When initial request has cookie set and redirect happens, it add extra Cookie header to that
abd request was broken. Just stop modifying the original request by passing a value.

Test: http/tests/cookies/multiple-redirect-and-set-cookie.php

* platform/network/ResourceHandle.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):

Source/WebKit:

When initial request has cookie set and redirect happens, it add extra Cookie header to that
abd request was broken. Just stop modifying the original request by passing a value.

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::createCurlRequest):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::restartWithCredential):
* NetworkProcess/curl/NetworkDataTaskCurl.h:

LayoutTests:

* http/tests/cookies/multiple-redirect-and-set-cookie-expected.txt: Added.
* http/tests/cookies/multiple-redirect-and-set-cookie.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cookies/multiple-redirect-and-set-cookie-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cookies/multiple-redirect-and-set-cookie.php [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/ResourceHandle.h
Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp
Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h