Skip to content

Commit e9fa313

Browse files
committed
bugfix: header_filter_by_lua*: now we ensure we always forward the exact return value of the ngx_http_filter_finalize_request() calls.
1 parent 82d0c26 commit e9fa313

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/ngx_http_lua_headerfilterby.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,8 @@ ngx_http_lua_header_filter_by_chunk(lua_State *L, ngx_http_request_t *r)
143143

144144
dd("finalize request with %d", (int) ctx->exit_code);
145145

146-
rc = ngx_http_filter_finalize_request(r, &ngx_http_lua_module,
147-
ctx->exit_code);
148-
if (rc == NGX_ERROR || rc == NGX_AGAIN) {
149-
return rc;
150-
}
151-
152-
return NGX_DECLINED;
146+
return ngx_http_filter_finalize_request(r, &ngx_http_lua_module,
147+
ctx->exit_code);
153148
}
154149

155150
return NGX_OK;
@@ -277,6 +272,10 @@ ngx_http_lua_header_filter(ngx_http_request_t *r)
277272

278273
ctx->context = old_context;
279274

275+
if (r->filter_finalize) {
276+
return rc;
277+
}
278+
280279
if (rc == NGX_DECLINED) {
281280
return NGX_OK;
282281
}

0 commit comments

Comments
 (0)