idbeta opened a new issue #863:
URL: https://github.com/apache/apisix-dashboard/issues/863


   # Bug report
   
   ## Describe the bug
   2.1 version create route with `cors` plugin and `cors` used the default 
setting `{}`, as below:
   ```
   
{"name":"test","uris":["/name"],"methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS","PATCH"],"plugins":{"cors":{}},"vars":[],"upstream":{"type":"roundrobin","timeout":{"connect":6000,"send":6000,"read":6000},"nodes":[{"host":"127.0.0.1","port":7000,"weight":1}]}}
   ```
   when request the route, will cause an error:
   ```
   *104794 failed to run header_filter_by_lua*: 
/Users/idbeta/1106/apisix/apisix/plugins/cors.lua:89: bad argument #1 to 
'str_find' (string expected, got nil)
   stack traceback:
        [C]: in function 'str_find'
        /Users/idbeta/1106/apisix/apisix/plugins/cors.lua:89: in function 
'create_obj_fun'
        /Users/idbeta/1106/apisix/apisix/core/lrucache.lua:92: in function 
'plugin_ctx'
        /Users/idbeta/1106/apisix/apisix/plugins/cors.lua:168: in function 
'phase_func'
        /Users/idbeta/1106/apisix/apisix/init.lua:159: in function 'run_plugin'
        /Users/idbeta/1106/apisix/apisix/init.lua:622: in function 
'common_phase'
        /Users/idbeta/1106/apisix/apisix/init.lua:632: in function 
'http_header_filter_phase'
        header_filter_by_lua:2: in main chunk while reading response header 
from upstream, client: 127.0.0.1, server: , request: "GET /name HTTP/1.1", 
upstream: "http://127.0.0.1:7000/name";, host: "127.0.0.1:9080"
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to