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

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

Issue 1476003002: Build content-type string in PasswordCredential::encodeFormData() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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/Source/modules/credentialmanager/PasswordCredential.cpp ('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/RequestInit.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/RequestInit.cpp b/third_party/WebKit/Source/modules/fetch/RequestInit.cpp
index a356d2643f4e1e86015b053a4f1434318855805b..dd14ee8c955bf9f043122129c93286eb20b1e3d0 100644
--- a/third_party/WebKit/Source/modules/fetch/RequestInit.cpp
+++ b/third_party/WebKit/Source/modules/fetch/RequestInit.cpp
@@ -92,11 +92,7 @@ RequestInit::RequestInit(ExecutionContext* context, const Dictionary& options, E
isCredentialRequest = true;
PasswordCredential* credential = V8PasswordCredential::toImpl(v8::Local<v8::Object>::Cast(v8Body));
- RefPtr<EncodedFormData> encodedData = credential->encodeFormData();
- if (encodedData->boundary().isEmpty())
- contentType = AtomicString("application/x-www-form-urlencoded;charset=UTF-8", AtomicString::ConstructFromLiteral);
- else
- contentType = AtomicString("multipart/form-data; boundary=", AtomicString::ConstructFromLiteral) + encodedData->boundary().data();
+ RefPtr<EncodedFormData> encodedData = credential->encodeFormData(contentType);
body = FetchFormDataConsumerHandle::create(context, encodedData.release());
} else if (v8Body->IsString()) {
contentType = "text/plain;charset=UTF-8";
« no previous file with comments | « third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698