Skip to content

Commit a9f85fd

Browse files
author
jiahao
committed
tests: updated test cases in t/request.t to reflect the changes in nginx 1.21.1.
No valid CONNECT requests are expected to appear within nginx since 1.21.1
1 parent 8c3c38f commit a9f85fd

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ env:
4444
- TEST_NGINX_RANDOMIZE=1
4545
- LUACHECK_VER=0.21.1
4646
matrix:
47-
- NGINX_VERSION=1.19.9 OPENSSL_VER=1.1.1l OPENSSL_PATCH_VER=1.1.1f
4847
- NGINX_VERSION=1.21.3 OPENSSL_VER=1.1.1l OPENSSL_PATCH_VER=1.1.1f
4948

5049
services:
@@ -64,7 +63,7 @@ install:
6463
- git clone https://github.com/openresty/openresty.git ../openresty
6564
- git clone https://github.com/openresty/openresty-devel-utils.git
6665
- git clone https://github.com/simpl/ngx_devel_kit.git ../ndk-nginx-module
67-
- git clone -b 0.10.21rc1 https://github.com/xiaocang/lua-nginx-module.git ../lua-nginx-module
66+
- git clone https://github.com/openresty/lua-nginx-module.git ../lua-nginx-module
6867
- git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx
6968
- git clone https://github.com/openresty/echo-nginx-module.git ../echo-nginx-module
7069
- git clone https://github.com/openresty/lua-resty-lrucache.git
@@ -73,7 +72,7 @@ install:
7372
- git clone https://github.com/openresty/set-misc-nginx-module.git ../set-misc-nginx-module
7473
- git clone https://github.com/openresty/mockeagain.git
7574
- git clone https://github.com/openresty/test-nginx.git
76-
- git clone -b 0.0.11rc1 https://github.com/xiaocang/stream-lua-nginx-module.git ../stream-lua-nginx-module
75+
- git clone https://github.com/openresty/stream-lua-nginx-module.git ../stream-lua-nginx-module
7776

7877
script:
7978
- cd luajit2/

t/request.t

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use t::TestCore;
88

99
repeat_each(2);
1010

11-
plan tests => repeat_each() * (blocks() * 5 + 5);
11+
plan tests => repeat_each() * (blocks() * 5 + 2);
1212

1313
#no_diff();
1414
#no_long_string();
@@ -439,6 +439,8 @@ qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
439439
[error]
440440
bad argument type
441441
stitch
442+
--- skip_nginx
443+
6: >= 1.21.1
442444

443445

444446

@@ -586,3 +588,27 @@ Foo: baz, 123
586588
--- http09
587589
--- response_body
588590
table,table
591+
592+
593+
594+
=== TEST 19: CONNECT method is considered invalid since nginx 1.21.1
595+
--- config
596+
location = /t {
597+
access_log off;
598+
content_by_lua_block {
599+
local t
600+
for i = 1, 500 do
601+
t = ngx.req.get_method()
602+
end
603+
ngx.say("method: ", t)
604+
ngx.req.discard_body()
605+
}
606+
}
607+
--- request
608+
CONNECT /t
609+
hello
610+
--- error_code: 405
611+
--- no_error_log
612+
[error]
613+
--- skip_nginx
614+
2: < 1.21.1

0 commit comments

Comments
 (0)