Permalink
Browse files

Merge pull request #118 from brainafk/master

Workaround for #97 + coffe transformation related bugfix
  • Loading branch information...
2 parents 1ad708c + 6da992e commit bbf2e1d61cd7f7f13ac37d3a1021e075ecee89b4 Francisco Treacy committed Mar 13, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/http_client.coffee
View
@@ -37,7 +37,7 @@ class HttpClient extends Client
[options, callback] = @ensure options
mapfunc = (v, k, options) ->
- data = if options.noJSON then Riak.mapValues(v)[0] else Riak.mapValuesJson(v)[0]
+ data = if options.noJSON then Riak.mapValues(v)[0] else if v.values[0].data.length > 0 then Riak.mapValuesJson(v)[0] else {}
if options.where and not options.noJSON
keys = []; `for (var i in options.where) keys.push(i)`
if keys.some((k) -> options.where[k] isnt data[k]) then return []
@@ -315,7 +315,7 @@ class HttpClient extends Client
decodeBuffer: (buffer, meta, verb) ->
try
if meta.statusCode is 204 or verb is 'HEAD' then undefined
- else if buffer == "" then buffer
+ else if buffer.length == 0 then buffer
else meta.decode(buffer)
catch e
new Error "Cannot convert response into #{meta.contentType}: #{e.message} -- Response: #{buffer}"

0 comments on commit bbf2e1d

Please sign in to comment.