Skip to content

Commit

Permalink
Merge r221081 - Regression(r221059): NetworkDataTask::didReceiveRespo…
Browse files Browse the repository at this point in the history
…nse() should not use PolicyUse for HTTP/0.9

https://bugs.webkit.org/show_bug.cgi?id=175872

Reviewed by Daniel Bates.

r221059 was calling the ResponseCompletionHandler with {} which ended up being
PolicyUse. Since this is an error case and do not want to receive the data, it
makes more sense to use PolicyIgnore instead. There should not be a behavior
change on WebKit side though since we are cancelling the load right after
calling the completion handler anyway.

Tests under http/tests/security/http-0.9/ are still passing.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):
  • Loading branch information
cdumez authored and carlosgcampos committed Aug 30, 2017
1 parent d0ce79f commit bc3d1c8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,21 @@
2017-08-23 Chris Dumez <cdumez@apple.com>

Regression(r221059): NetworkDataTask::didReceiveResponse() should not use PolicyUse for HTTP/0.9
https://bugs.webkit.org/show_bug.cgi?id=175872

Reviewed by Daniel Bates.

r221059 was calling the ResponseCompletionHandler with {} which ended up being
PolicyUse. Since this is an error case and do not want to receive the data, it
makes more sense to use PolicyIgnore instead. There should not be a behavior
change on WebKit side though since we are cancelling the load right after
calling the completion handler anyway.

Tests under http/tests/security/http-0.9/ are still passing.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):

2017-08-22 Chris Dumez <cdumez@apple.com>

Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/NetworkProcess/NetworkDataTask.cpp
Expand Up @@ -103,7 +103,7 @@ void NetworkDataTask::didReceiveResponse(ResourceResponse&& response, ResponseCo
auto url = response.url();
std::optional<uint16_t> port = url.port();
if (port && !isDefaultPortForProtocol(port.value(), url.protocol())) {
completionHandler({ });
completionHandler(PolicyIgnore);
cancel();
m_client->didCompleteWithError({ String(), 0, url, "Cancelled load from '" + url.stringCenterEllipsizedToLength() + "' because it is using HTTP/0.9." });
return;
Expand Down

0 comments on commit bc3d1c8

Please sign in to comment.