From 8582560883e48a586838b61781dcd045a2139ba8 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Mon, 2 Sep 2013 17:45:40 +0000 Subject: [PATCH] mod_lua: Remove ETAG, Content-Length, and Content-MD5 when a LuaOutputFilter is configured without mod_filter. [Eric Covener] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519483 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/lua/mod_lua.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGES b/CHANGES index 5864a31af2..7260c952d5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_lua: Remove ETAG, Content-Length, and Content-MD5 when a LuaOutputFilter + is configured without mod_filter. [Eric Covener] + *) mod_lua: Register LuaOutputFilter scripts as changing the content and content-length by default, when run my mod_filter. Previously, growing or shrinking a response that started with Content-Length set diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c index 4efe0e6dba..bdf5b16dfb 100644 --- a/modules/lua/mod_lua.c +++ b/modules/lua/mod_lua.c @@ -377,6 +377,12 @@ static apr_status_t lua_setup_filter_ctx(ap_filter_t* f, request_rec* r, lua_fil */ rc = lua_resume(L, 1); if (rc == LUA_YIELD) { + if (f->frec->providers == NULL) { + /* Not wired by mod_filter */ + apr_table_unset(r->headers_out, "Content-Length"); + apr_table_unset(r->headers_out, "Content-MD5"); + apr_table_unset(r->headers_out, "ETAG"); + } return OK; } else { -- 2.40.0