Blob/File type: preserve user-supplied MIME verbatim (WHATWG File API) #29258
Claude / Claude Code Review
completed
Apr 13, 2026 in 24m 2s
Code review found 1 important issue
Found 5 candidates, confirmed 5. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/bun.js/webcore/Blob.zig:2854-2866 |
getSliceFrom: content_type_was_set uses wrong length check, causing false positives |
Annotations
Check failure on line 2866 in src/bun.js/webcore/Blob.zig
claude / Claude Code Review
getSliceFrom: content_type_was_set uses wrong length check, causing false positives
In getSliceFrom (Blob.zig:2863), the PR replaces content_type_was_allocated with blob.content_type.len > 0 in the content_type_was_set formula, but blob.content_type at that point may already hold the inherited parent type (not a user-supplied value), causing the slice to be incorrectly marked as having a user-set content type. The correct operand is the content_type parameter (zero-length when the user passed no type), not the blob field after inheritance: use this.content_type_was_set or conte
Loading