Skip to content

fix: ContentType header should be Content-Type in auth.ts #1985#1994

Closed
Waqasabid99 wants to merge 1 commit intolingodotdev:mainfrom
Waqasabid99:main
Closed

fix: ContentType header should be Content-Type in auth.ts #1985#1994
Waqasabid99 wants to merge 1 commit intolingodotdev:mainfrom
Waqasabid99:main

Conversation

@Waqasabid99
Copy link

@Waqasabid99 Waqasabid99 commented Feb 17, 2026

Summary

Fix invalid ContentType header in auth.ts by replacing it with the correct "Content-Type" HTTP header.

Changes

Replaced ContentType with "Content-Type" in packages/cli/src/cli/utils/auth.ts
Ensured consistency with existing correct usage in observability.ts
Aligns with HTTP standard header naming

Testing

Business logic tests added:
Verified Headers behavior in Node — ContentType does not resolve as "Content-Type"
Confirmed "Content-Type" resolves correctly via Headers.get()
All tests pass locally

Additional verification:

Confirmed header is now correctly sent as content-type instead of contenttype

Visuals

N/A — no UI changes

Updated only Headers:
image

Checklist

Changeset added (not required — bug fix only, no public API changes)
Tests cover business logic (header correctness validation)
No breaking changes

Closes #1985

Summary by CodeRabbit

  • Bug Fixes
    • Fixed HTTP header formatting in authentication requests to ensure proper request handling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Fixed HTTP header name from ContentType to Content-Type in the authentication request headers. The invalid camelCase variant was being sent as lowercase contenttype, which is not a valid HTTP header. This correction ensures proper header transmission to API endpoints.

Changes

Cohort / File(s) Summary
HTTP Header Fix
packages/cli/src/cli/utils/auth.ts
Corrected header key from ContentType to "Content-Type" in fetch call headers for whoami request (line 25).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Poem

🐰 A hyphen slips in, neat and right,
ContentType? No—Content-Type's bright!
Headers now flow with proper care,
The fetch request floats through the air! ✨

🚥 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 accurately describes the main change: fixing the ContentType header to Content-Type in auth.ts, and includes the issue reference.
Description check ✅ Passed The description covers all required sections: Summary, Changes, Testing, Visuals, and Checklist, with appropriate details about the bug fix and verification.
Linked Issues check ✅ Passed The PR fully addresses issue #1985 by replacing the invalid ContentType header with the correct 'Content-Type' format, verified with tests demonstrating proper HTTP header behavior.
Out of Scope Changes check ✅ Passed The PR contains only the necessary change to fix the header name in auth.ts, with no unrelated modifications outside the scope of issue #1985.

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

@github-actions
Copy link
Contributor

Thanks for your interest in contributing! Before we can accept this PR, you'll need to be assigned to issue #1985 first. Please request assignment on the issue, or look for other unassigned issues that you can work on.

@github-actions github-actions bot closed this Feb 17, 2026
@vrcprl vrcprl reopened this Feb 17, 2026
@github-actions
Copy link
Contributor

Thank you for your contribution! However, this PR references issue #1985, which is currently assigned to another contributor. To contribute, please either get assigned to an issue first or find an unassigned issue to work on. You can find unassigned issues at https://github.com/lingo-dev/lingo.dev/issues?q=is%3Aissue+is%3Aopen+no%3Aassignee

@github-actions github-actions bot closed this Feb 17, 2026
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

2 participants