Skip to content

Commit

Permalink
fix: capture response status support 2xx
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellyu committed Sep 11, 2016
1 parent 210015a commit 5d836b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/apibus.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local cjson = require "cjson.safe";
local cjson = require 'cjson.safe';

ngx.req.read_body();
local post_args = ngx.req.get_post_args();
Expand Down Expand Up @@ -40,10 +40,10 @@ local responses = {ngx.location.capture_multi(seats)};
local bus = {};
local res;
for k, v in pairs(responses) do
if v.status == 200 then
if v.status >= 200 and v.status < 300 then
res = cjson.decode(v.body);
else
res = "error";
res = 'error';
end

table.insert(bus, k, res);
Expand Down

0 comments on commit 5d836b1

Please sign in to comment.