Skip to content

fix(effect-app): keep xForwardedHeaders error and request types - #928

Merged
omegent-app[bot] merged 2 commits into
mainfrom
t3-discord/x-forwarded-headers
Oct 23, 2026
Merged

omegent-app[bot] merged 2 commits into
mainfrom
t3-discord/x-forwarded-headers

Conversation

@omegent-app

@omegent-app omegent-app Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • effect-app/http re-exports HttpMiddleware and replaces xForwardedHeaders so the result keeps the app's error and HttpServerRequest requirement.
  • Effect 4.0.6 types that factory as HttpMiddleware, which returns Effect<HttpServerResponse, any, any>. The middleware only updates the current request. Import it from effect-app/http; effect/http is unchanged.

Test plan

  • Type test: the documented example is Effect<HttpServerResponse, never, HttpServerRequest>, and an app with error "Boom" and an extra service keeps both.
  • HttpRouter.middleware for the fixed helper matches cors (error: never, requires: never) instead of any.
  • Runtime: a trusted 10.0.0.0/8 peer still resolves X-Forwarded-For to 198.51.100.7.

opened by patroza in chat thread Discord · Discord · T3


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

omegent-app Bot and others added 2 commits October 23, 2026 08:13
Effect 4.0.6 types HttpMiddleware.xForwardedHeaders as HttpMiddleware, so the result is Effect<HttpServerResponse, any, any>. effect-app/http now re-exports that middleware with the app's error and HttpServerRequest requirement preserved.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
@omegent-app
omegent-app Bot marked this pull request as ready for review October 23, 2026 08:15
@omegent-app
omegent-app Bot merged commit 385600d into main Oct 23, 2026
3 checks passed
@omegent-app
omegent-app Bot deleted the t3-discord/x-forwarded-headers branch October 23, 2026 08:15
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.

0 participants