Skip to content

📝 CodeRabbit Chat: Implement requested code changes#600

Closed
coderabbitai[bot] wants to merge 1 commit into
feat/headless-mode-and-backend-configfrom
coderabbitai/chat/c7071e9
Closed

📝 CodeRabbit Chat: Implement requested code changes#600
coderabbitai[bot] wants to merge 1 commit into
feat/headless-mode-and-backend-configfrom
coderabbitai/chat/c7071e9

Conversation

@coderabbitai

@coderabbitai coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Code changes was requested by @awsl233777.

The following files were modified:

  • web/src/lib/backend-config.test.ts
  • web/src/lib/backend-config.ts

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7d19581-15ed-459c-bc19-733461bb0526

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@awsl233777

Copy link
Copy Markdown
Collaborator

This is the right direction for query/hash normalization, but the build-time helper still needs to preserve the runtime URL contract by rejecting non-http(s) protocols.

Current code accepts any parseable URL:

const parsed = new URL(trimmed);
return (parsed.origin + parsed.pathname).replace(/\/+$/, '');

That means VITE_BACKEND_URL=ftp://api.example.com becomes a configured backend fallback, while setBackendUrl('ftp://api.example.com') still correctly throws Backend URL must use http or https. The two entry points should not diverge.

Suggested fix: add the same protocol check to normalizeBackendOrigin() and add a regression test with vi.stubEnv('VITE_BACKEND_URL', 'ftp://api.example.com') expecting same-origin fallback (buildTransportConfig() undefined).

@coderabbitai coderabbitai Bot closed this Jun 5, 2026
@coderabbitai coderabbitai Bot deleted the coderabbitai/chat/c7071e9 branch June 5, 2026 11:11
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