# HG changeset patch # User Igor Sysoev # Date 1191255855 0 # Node ID 76fe59c6fafb2422a5edf29c9fd49b82f02939c0 # Parent 30fcc8478d858bb5dad6fff6223edbe3e89aa7a5 fix empty string replacement in sub_filter diff --git a/src/http/modules/ngx_http_sub_filter_module.c b/src/http/modules/ngx_http_sub_filter_module.c --- a/src/http/modules/ngx_http_sub_filter_module.c +++ b/src/http/modules/ngx_http_sub_filter_module.c @@ -369,9 +369,14 @@ ngx_http_sub_body_filter(ngx_http_reques } } - b->memory = 1; - b->pos = ctx->sub.data; - b->last = ctx->sub.data + ctx->sub.len; + if (ctx->sub.len) { + b->memory = 1; + b->pos = ctx->sub.data; + b->last = ctx->sub.data + ctx->sub.len; + + } else { + b->sync = 1; + } cl->buf = b; cl->next = NULL;