Commit 3ab5357
committed
fix: copy mutable file tuple containers to prevent shared state
File upload helpers were sharing mutable containers nested inside file
tuples, such as per-file headers dictionaries. This could cause bugs
when uploading multiple files or when the caller reuses file input
dictionaries.
- Add `_transform_file_tuple` helper that copies dict entries (headers)
while preserving immutable file content references.
- Use the helper in both `_transform_file` and `_async_transform_file`.
- Add regression test for file tuple with mutable headers.
Fixes #15481 parent 9aa85c8 commit 3ab5357
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
79 | 92 | | |
80 | 93 | | |
81 | 94 | | |
| |||
113 | 126 | | |
114 | 127 | | |
115 | 128 | | |
116 | | - | |
| 129 | + | |
117 | 130 | | |
118 | 131 | | |
119 | 132 | | |
| |||
0 commit comments