summaryrefslogtreecommitdiff
path: root/lib/oxidized/api/rest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/api/rest.rb')
-rw-r--r--lib/oxidized/api/rest.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/oxidized/api/rest.rb b/lib/oxidized/api/rest.rb
index f1a7ef5..1a426f5 100644
--- a/lib/oxidized/api/rest.rb
+++ b/lib/oxidized/api/rest.rb
@@ -4,9 +4,9 @@ module Oxidized
module API
class Rest
module Helpers
- def send res, json, msg='OK', status=200
+ def send res, msg='OK', ascii=false, status=200
res.body = msg
- if not json
+ if ascii
msg = {:result => msg}
res['Content-Type'] = 'application/json'
res.status = status
@@ -52,10 +52,10 @@ module Oxidized
else
group, node = 0, $1
end
- json = if node[-4..-1] == '.txt'
+ ascii = if node[-4..-1] == '.txt'
node = node[0..-5]
end
- send res, json, @nodes.fetch(node, group)
+ send res, @nodes.fetch(node, group), ascii
rescue Oxidized::NotSupported => e
send res, e
end