Index: third_party/WebKit/Source/modules/fetch/RequestInit.cpp |
diff --git a/third_party/WebKit/Source/modules/fetch/RequestInit.cpp b/third_party/WebKit/Source/modules/fetch/RequestInit.cpp |
index 98b3dea0e168604466591e3dfbf3ed795b65b326..d041edfe7fea8d2b159ffa404c6bfe196be9a3dc 100644 |
--- a/third_party/WebKit/Source/modules/fetch/RequestInit.cpp |
+++ b/third_party/WebKit/Source/modules/fetch/RequestInit.cpp |
@@ -11,6 +11,7 @@ |
#include "bindings/core/v8/V8Binding.h" |
#include "bindings/core/v8/V8Blob.h" |
#include "bindings/core/v8/V8FormData.h" |
+#include "bindings/core/v8/V8URLSearchParams.h" |
#include "core/fileapi/Blob.h" |
#include "core/html/FormData.h" |
#include "modules/fetch/FetchBlobDataConsumerHandle.h" |
@@ -78,6 +79,10 @@ RequestInit::RequestInit(ExecutionContext* context, const Dictionary& options, E |
// FormDataEncoder::generateUniqueBoundaryString. |
contentType = AtomicString("multipart/form-data; boundary=", AtomicString::ConstructFromLiteral) + formData->boundary().data(); |
body = FetchFormDataConsumerHandle::create(context, formData.release()); |
+ } else if (V8URLSearchParams::hasInstance(v8Body, isolate)) { |
+ RefPtr<EncodedFormData> formData = V8URLSearchParams::toImpl(v8::Local<v8::Object>::Cast(v8Body))->encodeFormData(); |
+ contentType = AtomicString("application/x-www-form-urlencoded;charset=UTF-8", AtomicString::ConstructFromLiteral); |
+ body = FetchFormDataConsumerHandle::create(context, formData.release()); |
} else if (v8Body->IsString()) { |
contentType = "text/plain;charset=UTF-8"; |
body = FetchFormDataConsumerHandle::create(toUSVString(isolate, v8Body, exceptionState)); |