why why why

This commit is contained in:
wiaamm
2025-12-15 14:32:49 +02:00
parent 1fefe4d996
commit 3e7a89604d

View File

@@ -140,6 +140,8 @@ end
function NanoHandler.header_filter(conf) function NanoHandler.header_filter(conf)
local ctx = kong.ctx.plugin local ctx = kong.ctx.plugin
ngx.header["Content-Length"] = nil
if nano.is_session_finalized(ctx.session_data) then if nano.is_session_finalized(ctx.session_data) then
kong.log.debug("Session has already been inspected, no need for further inspection") kong.log.debug("Session has already been inspected, no need for further inspection")
return return
@@ -164,7 +166,6 @@ function NanoHandler.header_filter(conf)
local status_code = kong.response.get_status() local status_code = kong.response.get_status()
local content_length = tonumber(headers["content-length"]) or 0 local content_length = tonumber(headers["content-length"]) or 0
local verdict, response = nano.send_response_headers(session_id, session_data, header_data, status_code, content_length) local verdict, response = nano.send_response_headers(session_id, session_data, header_data, status_code, content_length)
if verdict ~= nano.AttachmentVerdict.INSPECT then if verdict ~= nano.AttachmentVerdict.INSPECT then
ctx.cleanup_needed = true ctx.cleanup_needed = true
@@ -172,12 +173,9 @@ function NanoHandler.header_filter(conf)
kong.log.debug("DROP verdict in header_filter - sending block response immediately") kong.log.debug("DROP verdict in header_filter - sending block response immediately")
return nano.handle_custom_response(session_data, response) return nano.handle_custom_response(session_data, response)
end end
ngx.header["Content-Length"] = nil
return return
end end
ngx.header["Content-Length"] = nil
ctx.expect_body = not (status_code == 204 or status_code == 304 or (100 <= status_code and status_code < 200) or content_length == 0) ctx.expect_body = not (status_code == 204 or status_code == 304 or (100 <= status_code and status_code < 200) or content_length == 0)
end end
@@ -234,7 +232,6 @@ function NanoHandler.body_filter(conf)
return return
end end
end end
ngx.arg[1] = chunk ngx.arg[1] = chunk
return return
end end
@@ -255,7 +252,6 @@ function NanoHandler.body_filter(conf)
end end
end end
end end
end end
end end