Skip to content

Commit

Permalink
Merge pull request mostlyserious#118 from brainafk/master
Browse files Browse the repository at this point in the history
Workaround for mostlyserious#97 + coffe transformation related bugfix
  • Loading branch information
Francisco Treacy committed Mar 13, 2012
2 parents 1ad708c + 6da992e commit bbf2e1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http_client.coffee
Expand Up @@ -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 []
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit bbf2e1d

Please sign in to comment.