Skip to content

fix: use Content-Type header in auth.ts#1995

Open
Nixxx19 wants to merge 1 commit intolingodotdev:mainfrom
Nixxx19:fix/content-type-header-auth
Open

fix: use Content-Type header in auth.ts#1995
Nixxx19 wants to merge 1 commit intolingodotdev:mainfrom
Nixxx19:fix/content-type-header-auth

Conversation

@Nixxx19
Copy link

@Nixxx19 Nixxx19 commented Feb 18, 2026

Fixes #1985

Summary

Fixes invalid HTTP header name in auth.ts: replaces ContentType with "Content-Type" so the whoami request sends a valid Content-Type header.

Changes

  • Use "Content-Type": "application/json" instead of ContentType: "application/json" in packages/cli/src/cli/utils/auth.ts (line 25)
  • Aligns with HTTP spec and with existing usage in observability.ts

Testing

Business logic tests added:

  • No new unit tests (single-line header fix; behavior unchanged for correct servers)
  • Verified: grep "ContentType" returns nothing in auth.ts
  • Verified: auth.ts line 25 uses "Content-Type"
  • Verified via Node Headers that ContentType yields null for get('Content-Type') and "Content-Type" works
  • All tests pass locally

Visuals

Screenshot 2026-02-18 at 9 05 34 AM

Verification (Content-Type fix):

Screenshot below: terminal output from the verification command showing:

Screenshot 2026-02-18 at 9 12 33 AM
  1. No ContentType in auth.ts → OK
  2. auth.ts line 25"Content-Type": "application/json",
  3. Headers checkContentType → null; "Content-Type" → ok

Checklist

  • Changeset added (if version bump needed)
  • Tests cover business logic (not just happy path)
  • No breaking changes (or documented below)

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Corrected HTTP header formatting in authentication requests to comply with standard specifications, ensuring proper header recognition and improved compatibility with authentication services.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

A single HTTP header name was corrected in the authentication utility from the invalid camelCase ContentType to the standard hyphenated format "Content-Type" to ensure proper header transmission in API requests.

Changes

Cohort / File(s) Summary
HTTP Header Correction
packages/cli/src/cli/utils/auth.ts
Fixed invalid HTTP header name from ContentType to "Content-Type" on line 25 to comply with HTTP standards and ensure proper header transmission in fetch requests.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hops with glee,
ContentType? Nay, that cannot be!
With hyphens placed just right,
"Content-Type" shines bright! ✨
Now headers fly with proper plight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: fixing the Content-Type header in auth.ts.
Description check ✅ Passed The description covers the main objectives, includes verification steps, and references the linked issue, though some template sections are partially filled.
Linked Issues check ✅ Passed The PR directly addresses issue #1985 by fixing the invalid ContentType header to use the correct Content-Type format in auth.ts line 25, fully satisfying the bug fix requirements.
Out of Scope Changes check ✅ Passed The PR contains only the single-line header fix to auth.ts as specified in issue #1985 with no extraneous changes.

✏️ 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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

Bug: Fix ContentType header should be Content-Type in auth.ts

1 participant