Skip to content

Commit

Permalink
[echo] echo policy will not contact upstream
Browse files Browse the repository at this point in the history
* makes it way easier in tests to not stub upstream
  • Loading branch information
mikz committed Nov 21, 2017
1 parent 2f87120 commit 109e5cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions examples/configuration/echo.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"host": "echo"
},
"policy_chain": [
{ "name": "apicast.policy.echo" },
{ "name": "apicast.policy.apicast" }
{ "name": "apicast" }
],
"proxy_rules": [
{
Expand Down
5 changes: 3 additions & 2 deletions gateway/src/apicast/policy/echo.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
local policy = require('apicast.policy')
local _M = policy.new('Echo Policy')

function _M.access()
ngx.log(ngx.DEBUG, ngx.var.request)
function _M.rewrite()
ngx.say(ngx.var.request)
ngx.exit(0)
end

return _M

0 comments on commit 109e5cb

Please sign in to comment.