You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/10/07 11:54:25 UTC
[GitHub] [apisix] juzhiyuan commented on a change in pull request #5174: fix: refine admin API return JSON instead of code
juzhiyuan commented on a change in pull request #5174:
URL: https://github.com/apache/apisix/pull/5174#discussion_r724107103
##########
File path: apisix/admin/init.lua
##########
@@ -215,12 +215,12 @@ local function run_stream()
local resource = resources[seg_res]
if not resource then
- core.response.exit(404)
+ core.response.exit(404, {error_msg="not found"})
end
local method = str_lower(get_method())
if not resource[method] then
- core.response.exit(404)
+ core.response.exit(404, {error_msg="not found"})
Review comment:
according to https://github.com/apache/apisix/blob/master/CODE_STYLE.md#space , I would prefer using `xx = xx`
##########
File path: apisix/admin/init.lua
##########
@@ -192,13 +192,13 @@ local function run_stream()
if not local_conf.apisix.stream_proxy then
core.log.warn("stream mode is disabled, can not to add any stream ",
"route")
- core.response.exit(400)
+ core.response.exit(400, {error_msg="stream mode is disabled, can not " ..
Review comment:
Would better use `routes` instead of `route`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org