Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquid: Available context move to readwrite linked list. #1107

Merged
merged 1 commit into from
Aug 23, 2019

Commits on Aug 23, 2019

  1. 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>
    eloycoto committed Aug 23, 2019
    Configuration menu
    Copy the full SHA
    3430ba3 View commit details
    Browse the repository at this point in the history