soulbird commented on issue #9122:
URL: https://github.com/apache/apisix/issues/9122#issuecomment-1486515256

   I tried to reproduce with your config, but everything seems to work fine. 
Below is my test case:
   ```
   use t::APISIX 'no_plan';
   
   repeat_each(1);
   no_long_string();
   no_root_location();
   no_shuffle();
   add_block_preprocessor(sub {
        my ($block) = @_;
   
        if (!$block->request) {
            $block->set_value("request", "GET /t");
        }
   });
   
   run_tests();
   
   
   __DATA__
   
   === TEST 1: config
   ---config
        location /t {
            content_by_lua_block {
                local t = require("lib.test_admin").test
   
                local code, body = 
t('/apisix/admin/upstreams/452789772218270404',
                     ngx.HTTP_PUT,
                     [[{ "nodes": [{ "host": "httpbin.org", "port": 80, 
"weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": 
"roundrobin", "scheme": "http", "pass_host": "pass", "name": "httpbin", 
"keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } }]]
                    )
   
                if code > 300 then
                    return ngx.say(body)
                end
   
                code, body = t('/apisix/admin/services/452850410093281988',
                     ngx.HTTP_PUT,
                     [[{ "name": "servicea", "upstream_id": 
"452789772218270404" }]]
                    )
   
                if code > 300 then
                    return ngx.say(body)
                end
   
                code, body = t('/apisix/admin/routes/1',
                     ngx.HTTP_PUT,
                     [[{ "uri":"/servicea/*", "name":"route1", "methods":[ 
"GET", "POST", "PUT", "DELETE", "PATCH", "HEAD" , "OPTIONS", "CONNECT", 
"TRACE", "PURGE" ], "plugins":{ "proxy-rewrite":{ "regex_uri":[ 
"^/servicea/(.*)", "/${ 1}" ] } }, "service_id":"452850410093281988", 
"status":1 }]]
                    )
   
                if code > 300 then
                    return ngx.say(body)
                end
   
                ngx. say("passed")
            }
        }
   --- response_body
   passed
   
   
   
   === TEST 2: request
   --- pipelined_requests eval
   [
        "GET /servicea/anything", "GET /servicea/anything/123", "GET 
/servicea/cookies", "GET /servicea/cookies/set/john/121"
   ]
   --- error_code eval
   [
        200, 200, 200, 302
   ]
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to