WebKit Bugzilla
Attachment 358256 Details for
Bug 193082
: Remove logic handling DNT header during redirects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193082-20190103085144.patch (text/plain), 9.93 KB, created by
Brent Fulgham
on 2019-01-03 08:51:44 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2019-01-03 08:51:44 PST
Size:
9.93 KB
patch
obsolete
>Subversion Revision: 239578 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2b64654065768d0b80b01729caa2205e5e232037..209c023ae6e137c1c525dd664873fb35175c90d2 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,25 @@ >+2019-01-03 Brent Fulgham <bfulgham@apple.com> >+ >+ Remove logic handling DNT header during redirects >+ https://bugs.webkit.org/show_bug.cgi?id=193082 >+ <rdar://problem/45555965> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: http/wpt/fetch/dnt-header-after-redirection.html. >+ >+ Don't bother looking for (or passing along) DNT headers during redirects. >+ >+ * NetworkProcess/NetworkLoadChecker.cpp: >+ (WebKit::NetworkLoadChecker::check): >+ (WebKit::NetworkLoadChecker::prepareRedirectedRequest): Deleted. >+ * NetworkProcess/NetworkLoadChecker.h: >+ * NetworkProcess/NetworkResourceLoader.cpp: >+ (WebKit::NetworkResourceLoader::restartNetworkLoad): >+ (WebKit::NetworkResourceLoader::continueWillSendRequest): >+ * NetworkProcess/PingLoad.cpp: >+ (WebKit::PingLoad::willPerformHTTPRedirection): >+ > 2019-01-02 Brent Fulgham <bfulgham@apple.com> > > Remove unused logging service >diff --git a/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp b/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp >index dab152e9f3fd25c056fef466330065a666858da5..4e63b63462e18db4b955168b9b00a0bba0d803a6 100644 >--- a/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -84,21 +84,9 @@ void NetworkLoadChecker::check(ResourceRequest&& request, ContentSecurityPolicyC > m_loadInformation.request = request; > > m_firstRequestHeaders = request.httpHeaderFields(); >- // FIXME: We should not get this information from the request but directly from some NetworkProcess setting. >- m_dntHeaderValue = m_firstRequestHeaders.get(HTTPHeaderName::DNT); >- if (m_dntHeaderValue.isNull() && m_sessionID.isEphemeral()) { >- m_dntHeaderValue = "1"; >- request.setHTTPHeaderField(HTTPHeaderName::DNT, m_dntHeaderValue); >- } > checkRequest(WTFMove(request), client, WTFMove(handler)); > } > >-void NetworkLoadChecker::prepareRedirectedRequest(ResourceRequest& request) >-{ >- if (!m_dntHeaderValue.isNull()) >- request.setHTTPHeaderField(HTTPHeaderName::DNT, m_dntHeaderValue); >-} >- > static inline NetworkLoadChecker::RedirectionRequestOrError redirectionError(const ResourceResponse& redirectResponse, String&& errorMessage) > { > return makeUnexpected(ResourceError { String { }, 0, redirectResponse.url(), WTFMove(errorMessage), ResourceError::Type::AccessControl }); >diff --git a/Source/WebKit/NetworkProcess/NetworkLoadChecker.h b/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >index 5fcd8d0952297c2974477550d6019842b1459c9e..a1dc96acddfb10bb9550556e98838f5cec1dc43a 100644 >--- a/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >+++ b/Source/WebKit/NetworkProcess/NetworkLoadChecker.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -69,8 +69,6 @@ public: > using RedirectionValidationHandler = CompletionHandler<void(RedirectionRequestOrError&&)>; > void checkRedirection(WebCore::ResourceRequest&& request, WebCore::ResourceRequest&& redirectRequest, WebCore::ResourceResponse&& redirectResponse, WebCore::ContentSecurityPolicyClient*, RedirectionValidationHandler&&); > >- void prepareRedirectedRequest(WebCore::ResourceRequest&); >- > WebCore::ResourceError validateResponse(WebCore::ResourceResponse&); > > void setCSPResponseHeaders(WebCore::ContentSecurityPolicyResponseHeaders&& headers) { m_cspResponseHeaders = WTFMove(headers); } >@@ -143,7 +141,6 @@ private: > size_t m_redirectCount { 0 }; > URL m_previousURL; > WebCore::PreflightPolicy m_preflightPolicy; >- String m_dntHeaderValue; > String m_referrer; > bool m_checkContentExtensions { false }; > bool m_shouldCaptureExtraNetworkLoadMetrics { false }; >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >index 33ecaaf1fef429f4e0555c35a7755b8e7c302be7..97f1396c8505ba8bf2e7d4d7f14398773a5892d7 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2012-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2012-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -693,8 +693,6 @@ void NetworkResourceLoader::restartNetworkLoad(WebCore::ResourceRequest&& newReq > { > if (m_networkLoad) > m_networkLoad->cancel(); >- if (m_networkLoadChecker) >- m_networkLoadChecker->prepareRedirectedRequest(newRequest); > > startNetworkLoad(WTFMove(newRequest), FirstLoad::No); > } >@@ -717,9 +715,6 @@ void NetworkResourceLoader::continueWillSendRequest(ResourceRequest&& newRequest > > RELEASE_LOG_IF_ALLOWED("continueWillSendRequest: (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ")", m_parameters.webPageID, m_parameters.webFrameID, m_parameters.identifier); > >- if (m_networkLoadChecker) >- m_networkLoadChecker->prepareRedirectedRequest(newRequest); >- > m_isAllowedToAskUserForCredentials = isAllowedToAskUserForCredentials; > > // If there is a match in the network cache, we need to reuse the original cache policy and partition. >diff --git a/Source/WebKit/NetworkProcess/PingLoad.cpp b/Source/WebKit/NetworkProcess/PingLoad.cpp >index ca015efac342e734144d154a5de95a13bc9627d6..158ddb5326da94a3df1976ecba5a282bcb6549b5 100644 >--- a/Source/WebKit/NetworkProcess/PingLoad.cpp >+++ b/Source/WebKit/NetworkProcess/PingLoad.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016-2018 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -108,8 +108,6 @@ void PingLoad::willPerformHTTPRedirection(ResourceResponse&& redirectResponse, R > return; > } > auto request = WTFMove(result->redirectRequest); >- m_networkLoadChecker->prepareRedirectedRequest(request); >- > if (!request.url().protocolIsInHTTPFamily()) { > this->didFinish(ResourceError { String { }, 0, request.url(), "Redirection to URL with a scheme that is not HTTP(S)"_s, ResourceError::Type::AccessControl }); > return; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1f36ebf8576159f2b56076d5180d5cee62bd592c..97a3edf61410c176ec40932721136b5a70243d50 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-03 Brent Fulgham <bfulgham@apple.com> >+ >+ Remove logic handling DNT header during redirects >+ https://bugs.webkit.org/show_bug.cgi?id=193082 >+ <rdar://problem/45555965> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Revise test case to reflect fact that we no longer include the DNT >+ header in redirects. >+ >+ * http/wpt/fetch/dnt-header-after-redirection-expected.txt: >+ * http/wpt/fetch/dnt-header-after-redirection.html: >+ > 2019-01-02 Simon Fraser <simon.fraser@apple.com> > > Support css-color-4 rgb functions >diff --git a/LayoutTests/http/wpt/fetch/dnt-header-after-redirection-expected.txt b/LayoutTests/http/wpt/fetch/dnt-header-after-redirection-expected.txt >index 1ee6e382b4b5e6bc1ab44284c153cd983e975d52..a8f5be1c0e5d28003115020694aa958ebcf7b945 100644 >--- a/LayoutTests/http/wpt/fetch/dnt-header-after-redirection-expected.txt >+++ b/LayoutTests/http/wpt/fetch/dnt-header-after-redirection-expected.txt >@@ -1,6 +1,6 @@ > > >-PASS video load with DNT >-PASS Sync XHR with DNT >-PASS Beacon with DNT >+PASS video load without DNT >+PASS Sync XHR without DNT >+PASS Beacon without DNT > >diff --git a/LayoutTests/http/wpt/fetch/dnt-header-after-redirection.html b/LayoutTests/http/wpt/fetch/dnt-header-after-redirection.html >index 8bfaf5379b5e161bddecd9a2e5b4f2f96798cad3..b169b5e8c488ea8d345e57ae8d65e2e57a8f3233 100644 >--- a/LayoutTests/http/wpt/fetch/dnt-header-after-redirection.html >+++ b/LayoutTests/http/wpt/fetch/dnt-header-after-redirection.html >@@ -38,8 +38,8 @@ promise_test(async (test) => { > const finalURL = "dnt-status.py?store&token=" + token; > video.src = "resources/redirect.py?location=" + encodeURIComponent(finalURL); > >- assert_true(await checkDNTHeader(test, token), "DNT header is there"); >-}, "video load with DNT"); >+ assert_false(await checkDNTHeader(test, token), "DNT header is not there"); >+}, "video load without DNT"); > > promise_test(async (test) => { > const token = self.token(); >@@ -50,8 +50,8 @@ promise_test(async (test) => { > xhr.send(); > > const response = await fetch("resources/dnt-status.py?read&token=" + token); >- assert_equals(await response.text(), "1", "DNT header"); >-}, "Sync XHR with DNT"); >+ assert_equals(await response.text(), "-1", "DNT header"); >+}, "Sync XHR without DNT"); > > promise_test(async (test) => { > const token = self.token(); >@@ -59,8 +59,8 @@ promise_test(async (test) => { > > navigator.sendBeacon("resources/redirect.py?location=" + encodeURIComponent(finalURL), ""); > >- assert_true(await checkDNTHeader(test, token), "DNT header is there"); >-}, "Beacon with DNT"); >+ assert_false(await checkDNTHeader(test, token), "DNT header is not there"); >+}, "Beacon without DNT"); > </script> > </body> > </html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
cdumez
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193082
:
358190
|
358198
|
358199
|
358209
| 358256