Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Liquid: Available context move to readwrite linked list.
This commit allows users to use capture in their liquid expressions and assign variables if they needed. Due to the available_context return a readonly list, capture function cannot assign the variable and things start to mess up[0]. Due to allow users to define variables in liquid is quite bad, a new read-write linked list is created with an empty table to allow write to a temporal table. [0] Exception: ``` 2019/08/09 13:51:23 [error] 15620#15620: *9 lua entry thread aborted: runtime error: /home/centos/gateway/src/apicast/linked_list.lua:19: readonly list stack traceback: coroutine 0: [C]: in function 'error' /home/centos/gateway/src/apicast/linked_list.lua:19: in function '__newindex' ./lua_modules/share/lua/5.1/liquid.lua:2512: in function 'define_var' ./lua_modules/share/lua/5.1/liquid.lua:2459: in function 'visit' ./lua_modules/share/lua/5.1/liquid.lua:1975: in function 'render' /home/centos/gateway/src/apicast/policy/headers/headers.lua:91: in function 'run_commands' /home/centos/gateway/src/apicast/policy/headers/headers.lua:151: in function </home/centos/gateway/src/apicast/policy/headers/headers.lua:147> /home/centos/gateway/src/apicast/policy_chain.lua:200: in function 'rewrite' ...s/gateway/src/apicast/policy/local_chain/local_chain.lua:59: in function <...s/gateway/src/apicast/policy/local_chain/local_chain.lua:54> /home/centos/gateway/src/apicast/policy_chain.lua:200: in function 'rewrite' rewrite_by_lua(lua_Iy6Gdl:498):3: in main chunk, client: 172.18.0.1, server: _, request: "GET /bridge-1/?user_key=132 HTTP/1.1", host: "one" ``` Fix THREESCALE-1911 Signed-off-by: Eloy Coto <eloy.coto@gmail.com>
- Loading branch information