Permalink
Browse files

toString offsets

  • Loading branch information...
1 parent 5773156 commit 81a4337bee27de7b556fd45d07d602c0a8b72965 @chjj chjj committed Oct 18, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/multipart.js
View
@@ -176,8 +176,7 @@ Parser.prototype._parse = function(data) {
case 'header_name':
switch (ch) {
case COLON:
- val = buff.slice(0, this.pos);
- this.header = val.toString('ascii');
+ this.header = buff.toString('ascii', 0, this.pos);
this.pos = 0;
this.state = 'header_val';
break;
@@ -204,7 +203,7 @@ Parser.prototype._parse = function(data) {
case 'header_val_end':
switch (ch) {
case LF:
- val = buff.slice(0, this.pos).toString('ascii');
+ val = buff.toString('ascii', 0, this.pos);
this._header(this.header, val);
this.pos = 0;
this.state = 'header_end';

0 comments on commit 81a4337

Please sign in to comment.