Skip to content

Commit

Permalink
fix bug caused from failing to bind(this)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Williams committed Aug 17, 2015
1 parent 0d9bc90 commit eadc5a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sailthru.coffee
Expand Up @@ -65,7 +65,7 @@ class SailthruRequest

@log2 method + ' Request'

req = http_protocol.request options, (res) ->
req = http_protocol.request options, ((res) ->
body = ''
res.setEncoding 'utf8'
statusCode = res.statusCode
Expand All @@ -90,6 +90,7 @@ class SailthruRequest
error: 0,
errormsg: error.message
callback json_err, error.message
).bind(this)
req.on 'error', (err) ->
callback err, err.message
req.write url.format({query: options.query}).replace('?', ''), 'utf8' if method is 'POST'
Expand Down

0 comments on commit eadc5a0

Please sign in to comment.