Skip to content

Conversation

@nordrune
Copy link

@nordrune nordrune commented Dec 11, 2025

The reactStartHandler currently sets the host header to the full URL including the protocol:

headers.set("host", convexSiteUrl);

This results in values like http://127.0.0.1:3211 being used as the host header, but the HTTP Host header should only contain the hostname and port (e.g., 127.0.0.1:3211), never the protocol.

This causes 404 errors when using self-hosted Convex, which correctly rejects the invalid header.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Summary by CodeRabbit

  • Bug Fixes
    • Improved API request header handling for better compatibility and reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

The host header was being set to the full URL including protocol (e.g., "http://127.0.0.1:3211") instead of just hostname:port.

This violates HTTP spec and causes 404 errors with self-hosted Convex.
@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Walkthrough

The change modifies the Host header assignment in the request construction by extracting and using only the hostname from the convexSiteUrl rather than the full URL, while preserving all other request logic and error handling.

Changes

Cohort / File(s) Summary
Host header extraction
src/react-start/index.ts
Modified Host header assignment to extract only the hostname from convexSiteUrl instead of using the full URL

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file with localized change to header construction logic
  • No control flow modifications or side effects introduced
  • Straightforward hostname extraction without additional complexity

Poem

🐰 A header stripped down to its core name,
Full URLs fade while hostnames stay the same,
Simple, precise, no mess in sight,
One little fix makes everything right!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: fixing the host header format in reactStartHandler. It is concise, specific, and directly relates to the primary modification in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b0149f7 and 58f65f2.

📒 Files selected for processing (1)
  • src/react-start/index.ts (1 hunks)
🔇 Additional comments (1)
src/react-start/index.ts (1)

186-186: LGTM! Correct Host header format.

The change correctly extracts only the hostname and port from convexSiteUrl using new URL(convexSiteUrl).host, which is the proper format for the HTTP Host header per RFC 7230. This fixes the 404 errors with self-hosted Convex that were caused by including the protocol in the Host header.


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.

1 participant