Skip to content

Commit 950b1fb

Browse files
authored
bugfix: remove http2 hardcode limitation in ngx.location subrequest API.
1 parent 501ebac commit 950b1fb

20 files changed

+60
-60
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ env:
6363
#- NGINX_VERSION=1.25.1 OPENSSL_VER=1.1.1w TEST_NGINX_USE_HTTP2=1
6464
- NGINX_VERSION=1.27.1 OPENSSL_VER=1.1.1w OPENSSL_PATCH_VER=1.1.1f TEST_NGINX_TIMEOUT=5 PCRE_VER=8.45
6565
- NGINX_VERSION=1.27.1 OPENSSL_VER=3.0.15 OPENSSL_PATCH_VER=3.0.15 TEST_NGINX_TIMEOUT=5 PCRE2_VER=10.42
66+
- NGINX_VERSION=1.27.1 OPENSSL_VER=1.1.1w OPENSSL_PATCH_VER=1.1.1f TEST_NGINX_TIMEOUT=5 PCRE_VER=8.45 TEST_NGINX_USE_HTTP2=1
67+
- NGINX_VERSION=1.27.1 OPENSSL_VER=3.0.15 OPENSSL_PATCH_VER=3.0.15 TEST_NGINX_TIMEOUT=5 PCRE2_VER=10.42 TEST_NGINX_USE_HTTP2=1
6668
- NGINX_VERSION=1.27.1 OPENSSL_VER=3.0.15 OPENSSL_PATCH_VER=3.0.15 TEST_NGINX_USE_HTTP3=1 TEST_NGINX_QUIC_IDLE_TIMEOUT=3 PCRE2_VER=10.42
6769
- NGINX_VERSION=1.27.1 BORINGSSL=1 TEST_NGINX_USE_HTTP3=1 TEST_NGINX_QUIC_IDLE_TIMEOUT=3 PCRE2_VER=10.42
6870

src/ngx_http_lua_subrequest.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,6 @@ ngx_http_lua_ngx_location_capture_multi(lua_State *L)
173173
return luaL_error(L, "no request object found");
174174
}
175175

176-
#if (NGX_HTTP_V2)
177-
if (r->main->stream) {
178-
return luaL_error(L, "http2 requests not supported yet");
179-
}
180-
#endif
181-
182176
ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module);
183177
if (ctx == NULL) {
184178
return luaL_error(L, "no ctx found");

t/005-exit.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ GET /api?user=agentz
124124
125125
=== TEST 6: working with ngx_auth_request (simplest form, w/o ngx_memc)
126126
--- skip_eval: 3:$ENV{TEST_NGINX_USE_HTTP3}
127+
--- no_http2
127128
--- http_config eval
128129
"
129130
lua_package_cpath '$::LuaCpath';
@@ -197,6 +198,7 @@ Logged in 56
197198
198199
=== TEST 7: working with ngx_auth_request (simplest form)
199200
--- skip_eval: 3:$ENV{TEST_NGINX_USE_HTTP3}
201+
--- no_http2
200202
--- http_config eval
201203
"
202204
lua_package_cpath '$::LuaCpath';
@@ -269,6 +271,7 @@ Logged in 56
269271
270272
271273
=== TEST 8: working with ngx_auth_request
274+
--- no_http2
272275
--- skip_eval: 3:$ENV{TEST_NGINX_USE_HTTP3}
273276
--- http_config eval
274277
"
@@ -762,6 +765,7 @@ GET /t
762765
763766
764767
=== TEST 27: accepts NGX_ERROR
768+
--- no_http2
765769
--- config
766770
location = /t {
767771
content_by_lua_block {
@@ -780,6 +784,7 @@ curl: (95) HTTP/3 stream 0 reset by server
780784
781785
782786
=== TEST 28: accepts NGX_DECLINED
787+
--- no_http2
783788
--- config
784789
location = /t {
785790
content_by_lua_block {

t/014-bugs.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2
201201
header field names MUST be converted to lowercase prior to their
202202
encoding in HTTP/2. A request or response containing uppercase
203203
header field names MUST be treated as malformed
204-
204+
--- no_http2
205205
--- config
206206
location /sub {
207207
content_by_lua '

t/016-resp-header.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ Fooy: cony1, cony2
298298
299299
300300
=== TEST 15: set header after ngx.print
301+
--- no_http2
301302
--- config
302303
location /lua {
303304
default_type "text/plain";

t/020-subrequest.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,7 @@ body:
11981198
11991199
12001200
=== TEST 43: subrequests with an output body filter returning NGX_ERROR
1201+
--- no_http2
12011202
--- config
12021203
location /sub {
12031204
echo hello world;

t/023-rewrite/exit.t

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ GET /api?user=agentz
120120
121121
122122
=== TEST 6: working with ngx_auth_request (simplest form, w/o ngx_memc)
123+
--- no_http2
123124
--- http_config eval
124125
"
125126
lua_package_cpath '$::LuaCpath';
@@ -192,6 +193,7 @@ Logged in 56
192193
193194
194195
=== TEST 7: working with ngx_auth_request (simplest form)
196+
--- no_http2
195197
--- http_config eval
196198
"
197199
lua_package_cpath '$::LuaCpath';
@@ -264,6 +266,7 @@ Logged in 56
264266
265267
266268
=== TEST 8: working with ngx_auth_request
269+
--- no_http2
267270
--- http_config eval
268271
"
269272
lua_package_cpath '$::LuaCpath';

t/024-access/exit.t

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ GET /api?user=agentz
114114
115115
116116
=== TEST 6: working with ngx_auth_request (simplest form, w/o ngx_memc)
117+
--- no_http2
117118
--- http_config eval
118119
"
119120
lua_package_cpath '$::LuaCpath';
@@ -182,6 +183,7 @@ Logged in 56
182183
183184
184185
=== TEST 7: working with ngx_auth_request (simplest form)
186+
--- no_http2
185187
--- http_config eval
186188
"
187189
lua_package_cpath '$::LuaCpath';
@@ -249,6 +251,7 @@ Logged in 56
249251
250252
251253
=== TEST 8: working with ngx_auth_request
254+
--- no_http2
252255
--- http_config eval
253256
"
254257
lua_package_cpath '$::LuaCpath';

t/026-mysql.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ run_tests();
1616
__DATA__
1717

1818
=== TEST 1: when mysql query timed out, kill that query by Lua
19+
--- no_http2
1920
--- http_config
2021
upstream backend {
2122
drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql

t/033-ctx.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ GET /t
279279
--- error_log
280280
ngx.ctx = 32
281281
--- curl_error eval
282-
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 0 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
282+
qr/curl: \(52\) Empty reply from server|curl: \(92\) HTTP\/2 stream 1 was not closed cleanly|curl: \(95\) HTTP\/3 stream 0 reset by server/
283283

284284

285285

0 commit comments

Comments
 (0)