Skip to content

Commit 8a0fa13

Browse files
committed
return error response when received url not match any routes(apis)
1 parent a845e7d commit 8a0fa13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/apiserver.coffee

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class APIServer
105105
when '/stdin' then @on_stdin(req, res, params)
106106
when '/send' then @on_sendmsg(req, res, params)
107107
when '/reload'then @on_reload_plugin(req, res, params)
108+
else res.endjson {err:404,msg:'request not fits'}
108109

109110

110111
on_stdin : (req,res,params)->
@@ -160,4 +161,4 @@ exports.init = (qqbot)->
160161

161162
exports.stop = (qqbot)->
162163
api_server.stop()
163-
164+

0 commit comments

Comments
 (0)