diff --git a/packages/remix-fastify/src/server.ts b/packages/remix-fastify/src/server.ts index 3b900faa..ca4bf602 100644 --- a/packages/remix-fastify/src/server.ts +++ b/packages/remix-fastify/src/server.ts @@ -88,7 +88,8 @@ export function createRemixHeaders( export function getUrl( request: FastifyRequest, ): 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;