зеркало из https://github.com/mozilla/pjs.git
Bug 732369 - Content-Disposition parser does not require presence of ";" between params. r=jduell
This commit is contained in:
Родитель
4d4141d6be
Коммит
ff9787a741
|
@ -619,7 +619,13 @@ nsMIMEHeaderParamImpl::DoParameterInternal(const char *aHeaderValue,
|
||||||
// skip over whitespace, ';', whitespace.
|
// skip over whitespace, ';', whitespace.
|
||||||
increment_str:
|
increment_str:
|
||||||
while (nsCRT::IsAsciiSpace(*str)) ++str;
|
while (nsCRT::IsAsciiSpace(*str)) ++str;
|
||||||
if (*str == ';') ++str;
|
if (*str == ';') {
|
||||||
|
++str;
|
||||||
|
} else {
|
||||||
|
// stop processing the header field; either we are done or the
|
||||||
|
// separator was missing
|
||||||
|
break;
|
||||||
|
}
|
||||||
while (nsCRT::IsAsciiSpace(*str)) ++str;
|
while (nsCRT::IsAsciiSpace(*str)) ++str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ var tests = [
|
||||||
|
|
||||||
// First series, only please, and don't slurp up higher elements (*2 in this
|
// First series, only please, and don't slurp up higher elements (*2 in this
|
||||||
// case) from later series into earlier one (invalid; error recovery)
|
// case) from later series into earlier one (invalid; error recovery)
|
||||||
["attachment; filename=basic; filename*0*=UTF-8''multi\r\n"
|
["attachment; filename=basic; filename*0*=UTF-8''multi;\r\n"
|
||||||
+ " filename*1=line;\r\n"
|
+ " filename*1=line;\r\n"
|
||||||
+ " filename*0*=UTF-8''wrong;\r\n"
|
+ " filename*0*=UTF-8''wrong;\r\n"
|
||||||
+ " filename*1=bad;\r\n"
|
+ " filename*1=bad;\r\n"
|
||||||
|
@ -397,9 +397,16 @@ var tests = [
|
||||||
"attachment", "basic"],
|
"attachment", "basic"],
|
||||||
|
|
||||||
// Bug 732369: Content-Disposition parser does not require presence of ";" between params
|
// Bug 732369: Content-Disposition parser does not require presence of ";" between params
|
||||||
|
// optimally, this would not even return the disposition type "attachment"
|
||||||
|
|
||||||
["attachment; extension=bla filename=foo",
|
["attachment; extension=bla filename=foo",
|
||||||
|
"attachment", Cr.NS_ERROR_INVALID_ARG],
|
||||||
|
|
||||||
|
["attachment; filename=foo extension=bla",
|
||||||
"attachment", "foo"],
|
"attachment", "foo"],
|
||||||
|
|
||||||
|
["attachment filename=foo",
|
||||||
|
"attachment", Cr.NS_ERROR_INVALID_ARG],
|
||||||
];
|
];
|
||||||
|
|
||||||
var rfc5987paramtests = [
|
var rfc5987paramtests = [
|
||||||
|
|
Загрузка…
Ссылка в новой задаче