Skip to content
Permalink
Browse files
[curl] Requests interrupted when using https via proxy
https://bugs.webkit.org/show_bug.cgi?id=157028

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-04-26
Reviewed by Alex Christensen.

A proxy responds "200 Connection Established" to a CONNECT
method.  This response doesn't have Content-Type, then the
request is canceled due to a unsupported MIME type. This is not
a real response from the recipient server. It should not be
processed normally. Just ignore the response.

* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::headerCallback):
Do nothing if httpCode is 0. This is the case of "200 Connection Established".

Canonical link: https://commits.webkit.org/175155@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
fujii authored and webkit-commit-queue committed Apr 26, 2016
1 parent 7e610b9 commit dfe0d39dc7d2e66c67447846a93c417a4df45aeb
Showing with 21 additions and 0 deletions.
  1. +17 −0 Source/WebCore/ChangeLog
  2. +4 −0 Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
@@ -1,3 +1,20 @@
2016-04-26 Fujii Hironori <Hironori.Fujii@sony.com>

[curl] Requests interrupted when using https via proxy
https://bugs.webkit.org/show_bug.cgi?id=157028

Reviewed by Alex Christensen.

A proxy responds "200 Connection Established" to a CONNECT
method. This response doesn't have Content-Type, then the
request is canceled due to a unsupported MIME type. This is not
a real response from the recipient server. It should not be
processed normally. Just ignore the response.

* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::headerCallback):
Do nothing if httpCode is 0. This is the case of "200 Connection Established".

2016-04-26 Chris Dumez <cdumez@apple.com>

Drop Dictionary from CanUseWTFOptionalForParameter()
@@ -482,6 +482,10 @@ static size_t headerCallback(char* ptr, size_t size, size_t nmemb, void* data)
long httpCode = 0;
curl_easy_getinfo(h, CURLINFO_RESPONSE_CODE, &httpCode);

if (!httpCode) {
// Comes here when receiving 200 Connection Established. Just return.
return totalSize;
}
if (isHttpInfo(httpCode)) {
// Just return when receiving http info, e.g. HTTP/1.1 100 Continue.
// If not, the request might be cancelled, because the MIME type will be empty for this response.

0 comments on commit dfe0d39

Please sign in to comment.