Skip to content

Commit

Permalink
chore: support fastify v4 and v5
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh authored Nov 12, 2024
1 parent f10e6c7 commit d8ed64b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/remix-fastify/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export function createRemixHeaders(
export function getUrl<Server extends HttpServer>(
request: FastifyRequest<RouteGenericInterface, Server>,
): string {
let origin = `${request.protocol}://${request.host}`;
let host = "host" in request ? request.host : request.hostname;
let origin = `${request.protocol}://${host}`;
// Use `request.originalUrl` so Remix is aware of the full path
let url = `${origin}${request.originalUrl}`;
return url;
Expand Down

0 comments on commit d8ed64b

Please sign in to comment.