-
Notifications
You must be signed in to change notification settings - Fork 830
Fix the transformer plugin issue: file information is lost when processing body with files that the body type is multipart/form-data #2703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ssing body with files that the body type is multipart/form-data
修复 transformer 插件处理 multipart/form-data 时文件信息丢失的问题变更概述
变更文件
时序图sequenceDiagram
participant PB as parseBody
participant CB as constructBody
PB->>PB: 解析 multipart/form-data
PB->>PB: 识别文件字段
PB->>PB: 提取并保存文件名、内容类型和内容(Base64)
PB-->>CB: 返回处理后的 body 数据
CB->>CB: 构造 multipart/form-data
CB->>CB: 优先处理文件字段
CB->>CB: 使用 .filename 和 .content 还原文件部分
CB->>CB: 设置 Content-Disposition 和 Content-Type
CB-->>User: 返回构造完成的请求体
💡 小贴士与 lingma-agents 交流的方式📜 直接回复评论
📜 在代码行处标记
📜 在讨论中提问
|
@CH3CHO @erasernoob @johnlanni @rinfx Hi team, could you please review this PR and approve the pending workflows? The CLA has been signed and automated checks are passing. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2703 +/- ##
==========================================
+ Coverage 35.91% 44.99% +9.08%
==========================================
Files 69 82 +13
Lines 11576 13347 +1771
==========================================
+ Hits 4157 6006 +1849
+ Misses 7104 6993 -111
- Partials 315 348 +33 🚀 New features to boost your workflow:
|
@hanxiantao 感谢建议,无用log注释代码已删除。 @hanxiantao Thanks for the suggestion, useless log comment code has been removed. |
Remove blank line Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
@johnlanni 您好,单元测试相关内容已参照更新,请审核。
@johnlanni Hello, the unit test related content has been updated with reference, please review it. |
@johnlanni Build and Test Plugins / higress-wasmplugin-test (GO) (pull_request) |
Ⅰ. Describe what this PR did
Fix the transformer plugin issue: file information is lost when processing body with files that the body type is multipart/form-data
Ⅱ. Does this pull request fix one issue?
fixes #2257
Ⅲ. Why don't you add test cases (unit test/integration test)?
Comprehensive local testing has been performed to verify the fix works correctly with various multipart/form-data scenarios.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews