Skip to content

Commit 3078ca6

Browse files
committed
bugfix: we now throw a Lua exception when ngx.location.capture* Lua API is used inside an HTTP2 request since it is known to lead to hanging.
1 parent df1b019 commit 3078ca6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/ngx_http_lua_headers.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ ngx_http_lua_ngx_req_raw_header(lua_State *L)
113113

114114
#if (NGX_HTTP_V2)
115115
if (mr->stream) {
116-
return luaL_error(L, "http v2 not supported yet");
116+
return luaL_error(L, "http2 requests not supported yet");
117117
}
118118
#endif
119119

src/ngx_http_lua_subrequest.c

+6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ ngx_http_lua_ngx_location_capture_multi(lua_State *L)
166166
return luaL_error(L, "no request object found");
167167
}
168168

169+
#if (NGX_HTTP_V2)
170+
if (r->main->stream) {
171+
return luaL_error(L, "http2 requests not supported yet");
172+
}
173+
#endif
174+
169175
ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module);
170176
if (ctx == NULL) {
171177
return luaL_error(L, "no ctx found");

0 commit comments

Comments
 (0)