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

Unified Diff: third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.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
Index: third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp
diff --git a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp
index 41bf1f2fb7f1133711728cc39af00308dc2373a4..9a9acdb0753249ade8b2d7d80e549d917e5aaa1e 100644
--- a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp
+++ b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp
@@ -46,7 +46,7 @@ PasswordCredential::PasswordCredential(const String& id, const String& password,
{
}
-PassRefPtr<EncodedFormData> PasswordCredential::encodeFormData() const
+PassRefPtr<EncodedFormData> PasswordCredential::encodeFormData(String& contentType) const
{
if (m_additionalData.isURLSearchParams()) {
// If |additionalData| is a 'URLSearchParams' object, build a urlencoded response.
@@ -57,6 +57,8 @@ PassRefPtr<EncodedFormData> PasswordCredential::encodeFormData() const
params->append(idName(), id());
params->append(passwordName(), password());
+ contentType = AtomicString("application/x-www-form-urlencoded;charset=UTF-8", AtomicString::ConstructFromLiteral);
+
return params->encodeFormData();
}
@@ -74,7 +76,9 @@ PassRefPtr<EncodedFormData> PasswordCredential::encodeFormData() const
formData->append(idName(), id());
formData->append(passwordName(), password());
- return formData->encodeMultiPartFormData();
+ RefPtr<EncodedFormData> encodedData = formData->encodeMultiPartFormData();
+ contentType = AtomicString("multipart/form-data; boundary=", AtomicString::ConstructFromLiteral) + encodedData->boundary().data();
+ return encodedData.release();
}
const String& PasswordCredential::password() const

Powered by Google App Engine
This is Rietveld 408576698