Skip to content

优化http表单POST请求getParsedBody对原始请求体的加载:移除在getParsedBody对原始body加载的逻辑#718

Merged
Yurunsoft merged 1 commit into
imiphp:2.1from
Eno-CN:opt-2.1-http-request-upload-parse-body
Oct 14, 2025
Merged

优化http表单POST请求getParsedBody对原始请求体的加载:移除在getParsedBody对原始body加载的逻辑#718
Yurunsoft merged 1 commit into
imiphp:2.1from
Eno-CN:opt-2.1-http-request-upload-parse-body

Conversation

@Eno-CN
Copy link
Copy Markdown
Member

@Eno-CN Eno-CN commented Sep 30, 2025

直接从POST参数中获取,惰性加载原始Body,防止上传文件请求时直接加载整个文件二进制到内存中

@Yurunsoft
Copy link
Copy Markdown
Member

很多类里依赖 initBody()body 赋值,删掉会影响其他功能

@Eno-CN
Copy link
Copy Markdown
Member Author

Eno-CN commented Oct 11, 2025

依赖 initBody()body 赋值的地方,目前从本地代码检查的结果来看,除了目前已经修改的 getParsedBody() ,只有 getBody() 用到了,但修改的目的就是依赖 getBody() 去按需加载body @Yurunsoft

@Eno-CN Eno-CN force-pushed the opt-2.1-http-request-upload-parse-body branch from 55c2507 to 93d994c Compare October 13, 2025 09:55
@Eno-CN Eno-CN force-pushed the opt-2.1-http-request-upload-parse-body branch from 93d994c to cc145d5 Compare October 14, 2025 02:19
@Yurunsoft Yurunsoft merged commit 5433d18 into imiphp:2.1 Oct 14, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants