Skip to content

Fixing overwrite Blob/File type as Content-Type in browser. (#1773)#7

Open
MitchLewis930 wants to merge 1 commit intopr_027_beforefrom
pr_027_after
Open

Fixing overwrite Blob/File type as Content-Type in browser. (#1773)#7
MitchLewis930 wants to merge 1 commit intopr_027_beforefrom
pr_027_after

Conversation

@MitchLewis930
Copy link

@MitchLewis930 MitchLewis930 commented Jan 29, 2026

PR_027

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of file and blob uploads by removing manually set Content-Type when the payload is a Blob or File with a declared type, allowing the browser to set the correct header. This reduces incorrect/missing content type issues and improves upload reliability.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

The XHR adapter now removes the Content-Type header when request data is a Blob or File that has a type property, mirroring existing FormData behavior so the browser can set the header automatically.

Changes

Cohort / File(s) Summary
XHR Header Handling
lib/adapters/xhr.js
Added conditional to delete Content-Type header for Blob/File payloads with a type, placed alongside existing FormData header logic before request initialization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 A little file with a mime so bright,
I nudge the headers, step out of sight,
Let the browser hum its native tune,
Quietly setting type by moon,
Hoppy code — simple, light, and right.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing how Blob/File types are handled as Content-Type headers in the browser, which aligns with the code addition for Blob/File header handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into pr_027_before

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pr_027_after

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2b478f and f3cc053.

📒 Files selected for processing (1)
  • lib/adapters/xhr.js
🔇 Additional comments (1)
lib/adapters/xhr.js (1)

21-26: LGTM—consistent with FormData header handling.

This mirrors the existing FormData behavior and correctly lets the browser set Content-Type for Blob/File payloads with a type.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@MitchLewis930
Copy link
Author

@CodeRabbit full review

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

✅ Actions performed

Full review triggered.

@MitchLewis930
Copy link
Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

✅ Actions performed

Full review triggered.

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