зеркало из https://github.com/mozilla/gecko-dev.git
Bug 649150: Make sure that all blobs and files sent using FormData have a filename in the encoded submission. r=mounir
This commit is contained in:
Родитель
ecd449c529
Коммит
4e6a9c5461
|
@ -36,7 +36,7 @@ function testFile(file, contents, test) {
|
|||
[{ name: "hello", value: "world"},
|
||||
{ name: "myfile",
|
||||
value: contents,
|
||||
fileName: file.name || "",
|
||||
fileName: file.name || "blob",
|
||||
contentType: file.type || "application/octet-stream" }]);
|
||||
testHasRun();
|
||||
}
|
||||
|
|
|
@ -485,6 +485,11 @@ nsFSMultipartFormData::AddNameFilePair(const nsAString& aName,
|
|||
rv = file->GetName(filename16);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
if (filename16.IsEmpty()) {
|
||||
filename16.AssignLiteral("blob");
|
||||
}
|
||||
|
||||
rv = EncodeVal(filename16, filename, true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче