# HG changeset patch # User Igor Sysoev # Date 1163510108 0 # Node ID c2cae54f204594afce92bedcb6f1c3cf4ea65a76 # Parent eb5cf273e5d2d027886e455019462e2453bf7797 fix add_before_body without add_after_body diff --git a/src/http/modules/ngx_http_addition_filter_module.c b/src/http/modules/ngx_http_addition_filter_module.c --- a/src/http/modules/ngx_http_addition_filter_module.c +++ b/src/http/modules/ngx_http_addition_filter_module.c @@ -152,6 +152,11 @@ ngx_http_addition_body_filter(ngx_http_r } } + if (conf->after_body.len == 0) { + ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module); + return ngx_http_next_body_filter(r, in); + } + last = 0; for (cl = in; cl; cl = cl->next) {