Skip to content

fix(ai-openrouter): correct HTTP-Referrer header to HTTP-Referer#6145

Merged
IMax153 merged 2 commits intoEffect-TS:mainfrom
LikiosSedo:fix/openrouter-referer-header
Mar 25, 2026
Merged

fix(ai-openrouter): correct HTTP-Referrer header to HTTP-Referer#6145
IMax153 merged 2 commits intoEffect-TS:mainfrom
LikiosSedo:fix/openrouter-referer-header

Conversation

@LikiosSedo
Copy link
Copy Markdown
Contributor

Summary

The OpenRouter client sends HTTP-Referrer (double r) but the HTTP spec and OpenRouter API expect HTTP-Referer (single r). This causes app attribution via referrer/title to silently fail.

Fix

One-character fix: "HTTP-Referrer""HTTP-Referer" in the request header.

The referrer option name is kept as-is — it's a valid user-facing API name (consistent with JavaScript's own document.referrer), not an HTTP header.

Fixes #6143

The HTTP spec spells it "Referer" (single r). OpenRouter expects
this exact header name for app attribution. The current typo causes
referrer/title attribution to silently fail.

Fixes Effect-TS#6143
@LikiosSedo LikiosSedo requested a review from IMax153 as a code owner March 25, 2026 04:59
@github-project-automation github-project-automation bot moved this to Discussion Ongoing in PR Backlog Mar 25, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 25, 2026

🦋 Changeset detected

Latest commit: 727af71

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/ai-openrouter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@IMax153
Copy link
Copy Markdown
Member

IMax153 commented Mar 25, 2026

@LikiosSedo - 🤦 thanks for fixing my typo!

Could you please add a patch changeset to your PR via pnpm changeset with a short description of the changes made? Then I can get this in.

@LikiosSedo LikiosSedo closed this Mar 25, 2026
@github-project-automation github-project-automation bot moved this from Discussion Ongoing to Done in PR Backlog Mar 25, 2026
@LikiosSedo LikiosSedo reopened this Mar 25, 2026
@github-project-automation github-project-automation bot moved this from Done to Discussion Ongoing in PR Backlog Mar 25, 2026
@IMax153 IMax153 merged commit 6c39a34 into Effect-TS:main Mar 25, 2026
11 checks passed
@github-project-automation github-project-automation bot moved this from Discussion Ongoing to Done in PR Backlog Mar 25, 2026
@github-actions github-actions bot mentioned this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ai-openrouter: referer is not passed because of typo in http headers

2 participants