From 2016d41eb4046b6892c8a7d10e1c804db10ff0d1 Mon Sep 17 00:00:00 2001 From: David Ortiz Date: Wed, 17 Jan 2018 12:13:39 +0100 Subject: [PATCH] policy/apicast: override proxy's cache_handler if received via context --- gateway/src/apicast/policy/apicast/policy.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gateway/src/apicast/policy/apicast/policy.lua b/gateway/src/apicast/policy/apicast/policy.lua index da6e45294..ade7dba36 100644 --- a/gateway/src/apicast/policy/apicast/policy.lua +++ b/gateway/src/apicast/policy/apicast/policy.lua @@ -45,6 +45,11 @@ function _M:rewrite(context) -- because the module is reloaded and has to be configured again local p = context.proxy + + if context.cache_handler then + p.cache_handler = context.cache_handler + end + p.set_upstream(context.service) ngx.ctx.proxy = p end