New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Curl] Add Timing-Allow-Origin checks for Curl port #5802
Conversation
EWS run on current version of this PR (hash 95d6949) |
@@ -222,6 +226,8 @@ void NetworkDataTaskCurl::curlDidComplete(CurlRequest&, NetworkLoadMetrics&& net | |||
return; | |||
} | |||
|
|||
updateNetworkLoadMetrics(networkLoadMetrics); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cocoa port is calling checkTAO in willPerformHTTPRedirection and didReceiveResponse.
On the other hand, NetworkDataTaskCurl::updateNetworkLoadMetrics is called in curlDidComplete and curlDidReceiveResponse.
Is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is right. Cocoa port store NetworkLoadMetrics in a member variable of the NetworkDataTaskCocoa class.
WebCore::NetworkLoadMetrics m_networkLoadMetrics; |
On the other hand, Curl port does not store it and a new object is spawned every time when called CurlHandle::getNetworkLoadMetrics.
NetworkLoadMetrics networkLoadMetrics; |
m_response.networkLoadMetrics = networkLoadMetrics(); |
auto metrics = networkLoadMetrics(); |
The generated objects are then notified to curlDidReceiveResponse and curlDidComplete. Therefore, NetworkDataTaskCurl::updateNetworkLoadMetrics must be called in both curlDidReceiveResponse and curlDidComplete to update failsTAOCheck in NetworkLoadMetrics.
FileSystem::PlatformFileHandle m_downloadDestinationFile { FileSystem::invalidPlatformFileHandle }; | ||
|
||
bool m_blockingCookies { false }; | ||
|
||
WebCore::ShouldRelaxThirdPartyCookieBlocking m_shouldRelaxThirdPartyCookieBlocking { WebCore::ShouldRelaxThirdPartyCookieBlocking::No }; | ||
bool m_failsTAOCheck { false }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why only curl port adds m_failsTAOCheck
? Cocoa and Soup ports are using m_networkLoadMetrics.failsTAOCheck
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer is similar to the previous question. Curl port does not store NetworkLoadMetrics like Cocoa and SOUP. Therefor, curl port adds m_failsTAOCheck
to store results of failsTAOCheck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
https://bugs.webkit.org/show_bug.cgi?id=247048 Reviewed by Fujii Hironori. Add missing TAO checks to Curl backend. * LayoutTests/platform/wincairo/TestExpectations: * Source/WebCore/platform/network/curl/CurlResourceHandleDelegate.cpp: (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse): (WebCore::CurlResourceHandleDelegate::curlDidComplete): (WebCore::CurlResourceHandleDelegate::updateNetworkLoadMetrics): * Source/WebCore/platform/network/curl/CurlResourceHandleDelegate.h: * Source/WebKit/NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl): (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse): (WebKit::NetworkDataTaskCurl::curlDidComplete): (WebKit::NetworkDataTaskCurl::updateNetworkLoadMetrics): * Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.h: Canonical link: https://commits.webkit.org/256044@main
95d6949
to
3f6d008
Compare
Committed 256044@main (3f6d008): https://commits.webkit.org/256044@main Reviewed commits have been landed. Closing PR #5802 and removing active labels. |
3f6d008
95d6949
π§ͺ api-mac