Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Unified Diff: third_party/WebKit/Source/modules/fetch/Request.cpp

Issue 2783623003: Fetch API: Don't exclude the URL fragment in Request#url (Closed)
Patch Set: address comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/fetch/Request.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/Request.cpp b/third_party/WebKit/Source/modules/fetch/Request.cpp
index 666857c4d2cfa63055052f5c2b60276572164c31..7b710403a4381dfe5dbdc89e7fc27dfa779a39ae 100644
--- a/third_party/WebKit/Source/modules/fetch/Request.cpp
+++ b/third_party/WebKit/Source/modules/fetch/Request.cpp
@@ -493,13 +493,7 @@ String Request::method() const {
}
KURL Request::url() const {
- // The url attribute's getter must return request's url, serialized with the
- // exclude fragment flag set.
- if (!m_request->url().hasFragmentIdentifier())
- return m_request->url();
- KURL url(m_request->url());
- url.removeFragmentIdentifier();
- return url;
+ return m_request->url();
}
String Request::context() const {
@@ -696,8 +690,13 @@ void Request::populateWebServiceWorkerRequest(
WebServiceWorkerRequest& webRequest) const {
webRequest.setMethod(method());
webRequest.setRequestContext(m_request->context());
- // This strips off the fragment part.
- webRequest.setURL(url());
+
+ // Strip off the fragment part of URL. So far, all users of
+ // WebServiceWorkerRequest expect the fragment to be excluded.
+ KURL url(m_request->url());
+ if (m_request->url().hasFragmentIdentifier())
+ url.removeFragmentIdentifier();
+ webRequest.setURL(url);
const FetchHeaderList* headerList = m_headers->headerList();
for (size_t i = 0, size = headerList->size(); i < size; ++i) {
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698