Skip to content

Commit 38f4ff8

Browse files
authored
fix: restore old context when input of body filter is NULL (#104)
Signed-off-by: Nic <[email protected]>
1 parent a54d810 commit 38f4ff8

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git src/ngx_http_lua_bodyfilterby.c src/ngx_http_lua_bodyfilterby.c
2+
index 78e3b5c2..dba7261a 100644
3+
--- src/ngx_http_lua_bodyfilterby.c
4+
+++ src/ngx_http_lua_bodyfilterby.c
5+
@@ -368,6 +368,7 @@ ngx_http_lua_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
6+
}
7+
8+
} else {
9+
+ ctx->context = old_context;
10+
out = NULL;
11+
}
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git src/ngx_http_lua_bodyfilterby.c src/ngx_http_lua_bodyfilterby.c
2+
index 78e3b5c2..dba7261a 100644
3+
--- src/ngx_http_lua_bodyfilterby.c
4+
+++ src/ngx_http_lua_bodyfilterby.c
5+
@@ -368,6 +368,7 @@ ngx_http_lua_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
6+
}
7+
8+
} else {
9+
+ ctx->context = old_context;
10+
out = NULL;
11+
}
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git src/ngx_http_lua_bodyfilterby.c src/ngx_http_lua_bodyfilterby.c
2+
index c0484c8d..179a501a 100644
3+
--- src/ngx_http_lua_bodyfilterby.c
4+
+++ src/ngx_http_lua_bodyfilterby.c
5+
@@ -368,6 +368,7 @@ ngx_http_lua_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
6+
}
7+
8+
} else {
9+
+ ctx->context = old_context;
10+
out = NULL;
11+
}
12+

0 commit comments

Comments
 (0)