diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 14f7e96ec8aa..fd0a2342996c 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,20 @@ +2016-04-26 Fujii Hironori + + [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 Drop Dictionary from CanUseWTFOptionalForParameter() diff --git a/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp b/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp index a63a572f4ca3..3821fb991432 100644 --- a/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp +++ b/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp @@ -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.