Put content types and charsets on the text/plain parts of the form submission

for multipart POST submissions.  Bug 116346, patch by David Nesting
<david@fastolfe.net>, r=bzbarsky, sr=sicking


git-svn-id: svn://10.0.0.236/trunk@226372 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-05-14 04:00:49 +00:00
parent fa937acf1d
commit 000433da32

View File

@@ -770,6 +770,9 @@ nsFSMultipartFormData::AddNameValuePair(nsIDOMHTMLElement* aSource,
// RFC 2388 specifies that RFC 2047 be used, but I think it's not
// consistent with MIME standard.
mPostDataChunk += NS_LITERAL_CSTRING("--") + mBoundary
+ NS_LITERAL_CSTRING(CRLF)
+ NS_LITERAL_CSTRING("Content-Type: text/plain; charset=")
+ mCharset
+ NS_LITERAL_CSTRING(CRLF)
+ NS_LITERAL_CSTRING("Content-Disposition: form-data; name=\"")
+ nameStr + NS_LITERAL_CSTRING("\"" CRLF CRLF)
@@ -1161,6 +1164,9 @@ GetSubmissionFromForm(nsGenericHTMLElement* aForm,
nsCOMPtr<nsISaveAsCharset> encoder;
nsFormSubmission::GetEncoder(aForm, charset, getter_AddRefs(encoder));
if (!encoder)
charset.AssignLiteral("UTF-8");
// Get form processor
nsCOMPtr<nsIFormProcessor> formProcessor =
do_GetService(kFormProcessorCID, &rv);