File tree Expand file tree Collapse file tree 1 file changed +0
-60
lines changed
Expand file tree Collapse file tree 1 file changed +0
-60
lines changed Original file line number Diff line number Diff line change @@ -532,63 +532,3 @@ apisix-count: 3
532532X-2-RateLimit-Limit: 3
533533X-2-RateLimit-Remaining: 2
534534X-2-RateLimit-Reset: 60
535-
536-
537-
538- === TEST 18: use variable with default value in rules.key
539- --- config
540- location /t {
541- content_by_lua_block {
542- local t = require("lib.test_admin").test
543- local code, body = t('/apisix/admin/routes/1',
544- ngx.HTTP_PUT,
545- [[{
546- "methods": ["GET"],
547- "plugins": {
548- "limit-count": {
549- "rejected_code": 503,
550- "rules": [
551- {
552- "count": 1,
553- "time_window": 10,
554- "key": "${http_project ?? apisix}"
555- }
556- ]
557- }
558- },
559- "upstream": {
560- "nodes": {
561- "127.0.0.1:1980": 1
562- },
563- "type": "roundrobin"
564- },
565- "uri": "/hello"
566- }]]
567- )
568-
569- if code >= 300 then
570- ngx.status = code
571- end
572- ngx.say(body)
573- }
574- }
575- --- response_body
576- passed
577-
578-
579-
580- === TEST 19: with project header
581- --- request
582- GET /hello
583- --- more_headers
584- project: kubernetes
585- --- error_log eval
586- qr/limit key: \/apisix\/routes\/1:[^:]+:kubernetes/
587-
588-
589-
590- === TEST 20: without project header
591- --- request
592- GET /hello
593- --- error_log eval
594- qr/limit key: \/apisix\/routes\/1:[^:]+:apisix/
You can’t perform that action at this time.
0 commit comments