Skip to content

Commit c2120e1

Browse files
TanukiSharpSebastien
authored andcommitted
Fixed quoted-string parsing regular expression for the "name" parameter of the Content-Disposition header (RFC 2616 section 2.2, a quoted-string can be empty)
1 parent 7c7416a commit c2120e1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/incoming_form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ IncomingForm.prototype._initMultipart = function(boundary) {
353353
part.headers[headerField] = headerValue;
354354

355355
// matches either a quoted-string or a token (RFC 2616 section 19.5.1)
356-
var m = headerValue.match(/\bname=("([^"]+)"|([^\(\)<>@,;:\\"\/\[\]\?=\{\}\s\t/]+))/i);
356+
var m = headerValue.match(/\bname=("([^"]*)"|([^\(\)<>@,;:\\"\/\[\]\?=\{\}\s\t/]+))/i);
357357
if (headerField == 'content-disposition') {
358358
if (m) {
359359
part.name = m[1];

0 commit comments

Comments
 (0)