Skip to content

fix(request): use first forwarded host - #138

Open
bun-unsafe wants to merge 1 commit into
adonisjs:9.xfrom
bun-unsafe:fix/f-http-004
Open

fix(request): use first forwarded host#138
bun-unsafe wants to merge 1 commit into
adonisjs:9.xfrom
bun-unsafe:fix/f-http-004

Conversation

@bun-unsafe

Copy link
Copy Markdown

Problem

When a trusted proxy sends a multi-hop X-Forwarded-Host header, HttpRequest#host() returns the entire comma-separated value. This also corrupts hostname() and completeUrl().

Fix

Use the first forwarded host, consistent with the existing X-Forwarded-Proto handling.

Testing

  • npm run quick:test
  • npm run typecheck
  • npm run lint

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