You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2019/12/02 12:03:59 UTC

[GitHub] [incubator-apisix] lilien1010 opened a new issue #924: bug: router config doesn't match the one with host

lilien1010 opened a new issue #924: bug: router config doesn't match the one with host
URL: https://github.com/apache/incubator-apisix/issues/924
 
 
   ### Issue description
    
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): master
   * OS: linux
   
   ### Minimal test code / Steps to reproduce the issue
   ```
   === TEST 13: set route(id: 1)
   --- config
       location /t {
           content_by_lua_block {
               local t = require("lib.test_admin").test
               local code, body = t('/apisix/admin/routes/1',
                   ngx.HTTP_PUT,
                   [[{
                       "uri": "/server_port/*",
                       "upstream": {
                           "nodes": {
                               "127.0.0.1:1980": 1
                           },
                           "type": "roundrobin"
                       }
                   }]]
               )
   
               if code >= 300 then
                   ngx.status = code
               end
   
               local t = require("lib.test_admin").test
               local code, body = t('/apisix/admin/routes/2',
                   ngx.HTTP_PUT,
                   [[{
                       "uri": "/server_port/*", 
                       "hosts": ["test.qq.com"],
                       "upstream": {
                           "nodes": {
                               "127.0.0.1:1981": 1
                           },
                           "type": "roundrobin"
                       }
                   }]]
               )
   
               ngx.say(body)
           }
       }
   --- request
   GET /t
   --- response_body
   passed
   --- no_error_log
   [error]
   
   
   === TEST 14: hit routes
   --- request
   GET /server_port/3/3
   --- more_headers
   Host: test.qq.com
   --- response_body eval
   qr/1981/
   --- no_error_log
   [error]
   
   ```
   
   ### What's the actual result? (including assertion message & call stack if applicable)
   
   the test case above won't pass.
   
   ### What's the expected result?
   my expection is that it should pass
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services