Index: third_party/WebKit/Source/core/dom/URLSearchParams.cpp |
diff --git a/third_party/WebKit/Source/core/dom/URLSearchParams.cpp b/third_party/WebKit/Source/core/dom/URLSearchParams.cpp |
index 5fbe139215e0bffd8ac5ce2a428b58325a4f0509..5e3493b5ef114cedc23267b86fd886a103b47a22 100644 |
--- a/third_party/WebKit/Source/core/dom/URLSearchParams.cpp |
+++ b/third_party/WebKit/Source/core/dom/URLSearchParams.cpp |
@@ -38,8 +38,12 @@ private: |
URLSearchParams* URLSearchParams::create(const URLSearchParamsInit& init) |
{ |
- if (init.isUSVString()) |
- return new URLSearchParams(init.getAsUSVString()); |
+ if (init.isUSVString()) { |
+ const String& queryString = init.getAsUSVString(); |
+ if (queryString.startsWith('?')) |
+ return new URLSearchParams(queryString.substring(1)); |
+ return new URLSearchParams(queryString); |
+ } |
if (init.isURLSearchParams()) |
return new URLSearchParams(init.getAsURLSearchParams()); |