Skip to content

Commit

Permalink
fix: update url generation for fastify v5 (#458)
Browse files Browse the repository at this point in the history
* Update server.ts

* chore: support fastify v4 and v5

* Update server.ts

* Update server.ts

Signed-off-by: Logan McAnsh <[email protected]>

* Create little-zebras-admire.md

Signed-off-by: Logan McAnsh <[email protected]>

---------

Signed-off-by: Logan McAnsh <[email protected]>
  • Loading branch information
mcansh authored Nov 12, 2024
1 parent 9f2ad4a commit bf0b464
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/little-zebras-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mcansh/remix-fastify": patch
---

fix: update url generation for fastify v5
2 changes: 1 addition & 1 deletion packages/remix-fastify/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function createRemixHeaders(
export function getUrl<Server extends HttpServer>(
request: FastifyRequest<RouteGenericInterface, Server>,
): string {
let origin = `${request.protocol}://${request.hostname}`;
let origin = `${request.protocol}://${request.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 bf0b464

Please sign in to comment.