Skip to content

Commit

Permalink
Convert buffer to string explicitly.
Browse files Browse the repository at this point in the history
Otherwise multipart responses fail to be properly parsed.
  • Loading branch information
roidrage committed Nov 18, 2011
1 parent 3a0da2e commit d7d1c64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.coffee
Expand Up @@ -6,7 +6,7 @@ module.exports =

escape = (text) -> text.replace /[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"

data = data.split(new RegExp("\r?\n--#{escape boundary}--\r?\n"))?[0] or ""
data = data.toString().split(new RegExp("\r?\n--#{escape boundary}--\r?\n"))?[0] or ""

data.split(new RegExp("\r?\n--#{escape boundary}\r?\n")).filter((e) -> !!e).map (part) ->

Expand Down Expand Up @@ -98,4 +98,4 @@ module.exports =
# else
# target[key] = value
#
# return a
# return a

0 comments on commit d7d1c64

Please sign in to comment.