Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #120 from bcherry/multipart-leading-crlf

Ignore leading CR/LF characters in multipart body
  • Loading branch information...
commit b44d5a4784040319faf6375735beeffb223bac62 2 parents ef7316e + 6715425
@svnlto svnlto authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/multipart_parser.js
View
5 lib/multipart_parser.js
@@ -123,6 +123,11 @@ MultipartParser.prototype.write = function(buffer) {
case S.PARSER_UNINITIALIZED:
return i;
case S.START:
+ // skip leading CR/LF
+ if (c == CR || c == LF) {
+ continue;
+ }
+
index = 0;
state = S.START_BOUNDARY;
case S.START_BOUNDARY:

4 comments on commit b44d5a4

@andrewrk
Collaborator

I'd feel more comfortable if we had a test case covering this before merging it into master.

@svnlto
Collaborator

fair enough, let's roll back. I'll have a look at the test for this.

@felixge
Owner

Yeah, IMO a test for this would be good.

@andrewrk
Collaborator

Going to leave it committed, but resolve #177 asap.

Please sign in to comment.
Something went wrong with that request. Please try again.