Skip to content

Commit

Permalink
bugfix: we now throw a Lua exception when ngx.location.capture* Lua A…
Browse files Browse the repository at this point in the history
…PI is used inside an HTTP2 request since it is known to lead to hanging.
  • Loading branch information
agentzh committed Jan 26, 2018
1 parent df1b019 commit 3078ca6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ngx_http_lua_headers.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ngx_http_lua_ngx_req_raw_header(lua_State *L)

#if (NGX_HTTP_V2)
if (mr->stream) {
return luaL_error(L, "http v2 not supported yet");
return luaL_error(L, "http2 requests not supported yet");
}
#endif

Expand Down
6 changes: 6 additions & 0 deletions src/ngx_http_lua_subrequest.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ ngx_http_lua_ngx_location_capture_multi(lua_State *L)
return luaL_error(L, "no request object found");
}

#if (NGX_HTTP_V2)
if (r->main->stream) {
return luaL_error(L, "http2 requests not supported yet");
}
#endif

ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module);
if (ctx == NULL) {
return luaL_error(L, "no ctx found");
Expand Down

0 comments on commit 3078ca6

Please sign in to comment.