Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

body_filter_by_lua breaks APIs in other contexts in anything greater then 1.19

未关闭
#324 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
lua, nginx

调研方向

首先,使用 OpenResty 1.19 及更高版本的 Docker 镜像运行链接的复现仓库。比较同时定义 body_filter_by_lua 和 content_by_lua_block 时的行为,重点关注缓冲请求和 ngx.flush(true);完成标准是确定 lua-resty-http 是否涉及其中,并通过可复现的结果记录或修复该问题。

由索引模型根据 Issue 内容生成。

描述

I've logged this as a bug over in the lua-nginx-module repo but incase it's a bug in this code base instead thought I would log it here as well.

https://github.com/openresty/lua-nginx-module/issues/2372


We've been attempting to upgrade some legacy code to a newer version of openresty and hit a road block getting to anything greater then 1.19

We've found an issue that exists in any version greater then openresty 1.19 when using body_filter_by_lua and content_by_lua_block blocks.

I've created a reproduction case here - https://github.com/cdloh/body_filter_by_lua-bug-openresty

I've used lua-resty-http to make making the request easier.

When using both body_filter_by_lua and content_by_lua_block it's impossible to use APIs like ngx.flush(true) if there is any buffering going on. Eventually even if the flush code is only within content_by_lua blocks openresty complains about that API being disabled in body_filter_by_lua phases.

Note that you don't have to be actually doing anything in the body_filter_by_lua block at all. Simply having it defined causes the bug to occur.

You can run the some reproduction repo against 1.19 docker iamges and it work fine, however anything greater and it breaks.

主要语言
Lua
星标
2.1k
派生
630
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ledgetech/lua-resty-http 的其他 Issue

查看 ledgetech/lua-resty-http 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。