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

Unified Diff: content/browser/service_worker/service_worker_controllee_request_handler.cc

Issue 308053003: ServiceWorker: Strip away fragments from document url (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_controllee_request_handler.cc
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc
index 148ce443174481e11b288cbd84d5374aa2bbea08..241820045d076080ecbffe9831e0872e8e8e80d7 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -10,6 +10,7 @@
#include "content/browser/service_worker/service_worker_url_request_job.h"
#include "content/browser/service_worker/service_worker_utils.h"
#include "content/common/service_worker/service_worker_types.h"
+#include "net/base/net_util.h"
#include "net/url_request/url_request.h"
namespace content {
@@ -52,10 +53,13 @@ net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob(
// It's for original request (A) or redirect case (B-a or B-b).
DCHECK(!job_.get() || job_->ShouldForwardToServiceWorker());
+ // Strip away reference fragments.
+ const GURL& stripped_url(net::SimplifyUrlForRequest(request->url()));
michaeln 2014/05/30 23:38:47 const GURL&, doesn't look right here i'd put this
nhiroki 2014/06/02 06:26:08 Ah, it's a slip of the finger. Good catch!
+
job_ = new ServiceWorkerURLRequestJob(request, network_delegate,
provider_host_);
if (ServiceWorkerUtils::IsMainResourceType(resource_type_))
- PrepareForMainResource(request->url());
+ PrepareForMainResource(stripped_url);
else
PrepareForSubResource();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698