|
| 1 | +diff --git src/ngx_http_lua_bodyfilterby.c src/ngx_http_lua_bodyfilterby.c |
| 2 | +index 9024889..88af761 100644 |
| 3 | +--- src/ngx_http_lua_bodyfilterby.c |
| 4 | ++++ src/ngx_http_lua_bodyfilterby.c |
| 5 | +@@ -22,6 +22,9 @@ |
| 6 | + #include "ngx_http_lua_misc.h" |
| 7 | + #include "ngx_http_lua_consts.h" |
| 8 | + #include "ngx_http_lua_output.h" |
| 9 | ++#if (NGX_HTTP_APISIX) |
| 10 | ++#include "ngx_http_apisix_module.h" |
| 11 | ++#endif |
| 12 | + |
| 13 | + |
| 14 | + static void ngx_http_lua_body_filter_by_lua_env(lua_State *L, |
| 15 | +@@ -241,6 +244,12 @@ ngx_http_lua_body_filter(ngx_http_request_t *r, ngx_chain_t *in) |
| 16 | + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
| 17 | + "lua body filter for user lua code, uri \"%V\"", &r->uri); |
| 18 | + |
| 19 | ++#if (NGX_HTTP_APISIX) |
| 20 | ++ if (ngx_http_apisix_is_body_filter_by_lua_skipped(r)) { |
| 21 | ++ return ngx_http_next_body_filter(r, in); |
| 22 | ++ } |
| 23 | ++#endif |
| 24 | ++ |
| 25 | + llcf = ngx_http_get_module_loc_conf(r, ngx_http_lua_module); |
| 26 | + |
| 27 | + if (llcf->body_filter_handler == NULL || r->header_only) { |
| 28 | +diff --git src/ngx_http_lua_headerfilterby.c src/ngx_http_lua_headerfilterby.c |
| 29 | +index ed0c3a6..5f04992 100644 |
| 30 | +--- src/ngx_http_lua_headerfilterby.c |
| 31 | ++++ src/ngx_http_lua_headerfilterby.c |
| 32 | +@@ -19,6 +19,9 @@ |
| 33 | + #include "ngx_http_lua_string.h" |
| 34 | + #include "ngx_http_lua_misc.h" |
| 35 | + #include "ngx_http_lua_consts.h" |
| 36 | ++#if (NGX_HTTP_APISIX) |
| 37 | ++#include "ngx_http_apisix_module.h" |
| 38 | ++#endif |
| 39 | + |
| 40 | + |
| 41 | + static ngx_http_output_header_filter_pt ngx_http_next_header_filter; |
| 42 | +@@ -80,6 +83,12 @@ ngx_http_lua_header_filter_by_chunk(lua_State *L, ngx_http_request_t *r) |
| 43 | + #endif |
| 44 | + ngx_http_lua_ctx_t *ctx; |
| 45 | + |
| 46 | ++#if (NGX_HTTP_APISIX) |
| 47 | ++ if (ngx_http_apisix_is_header_filter_by_lua_skipped(r)) { |
| 48 | ++ return NGX_OK; |
| 49 | ++ } |
| 50 | ++#endif |
| 51 | ++ |
| 52 | + ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module); |
| 53 | + if (ctx->exited) { |
| 54 | + old_exit_code = ctx->exit_code; |
0 commit comments