-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update server definition #352
base: main
Are you sure you want to change the base?
Conversation
const untypedServer = server as unknown as any | ||
untypedServer.ip = server.requestIP(req) | ||
return app.fetch(req, untypedServer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if regressions will occur, but it is better to pass only ip
to env now.
const untypedServer = server as unknown as any | |
untypedServer.ip = server.requestIP(req) | |
return app.fetch(req, untypedServer) | |
const ip = server.requestIP(req) | |
return app.fetch(req, {ip}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried and still have the error that is mentionned
honojs/hono#2645 (comment)
Or maybe we can wait for this issue
honojs/hono#2696
const ip = server.requestIP(req)
return app.fetch(req, {ip})
const untypedServer = server as unknown as any | ||
untypedServer.ip = server.requestIP(req) | ||
return app.fetch(req, untypedServer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const untypedServer = server as unknown as any | |
untypedServer.ip = server.requestIP(req) | |
return app.fetch(req, untypedServer); | |
const ip = server.requestIP(req) | |
return app.fetch(req, {ip}) |
@mathysth This has been fixed in 4.4.0. There is now a ConnInfo Helper to get the IP address. |
Update how the server is defined because it could introduce regressions for some Bun HTTP features.
honojs/hono#2645 (comment)