Skip to content

Commit ff9cbb4

Browse files
authored
chore: update get origin for tests (#5453)
* update origin for test * move import
1 parent 5363634 commit ff9cbb4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/origin.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import { headers } from "next/headers";
2-
31
/**
42
* Extract the origin from the request's headers.
53
*/
64
export async function getOrigin(): Promise<string> {
5+
if (process.env.APP_ENV === "test") {
6+
return "https://test.forms-formulaires.canada.ca";
7+
}
8+
9+
const { headers } = await import("next/headers");
10+
711
const h = await headers();
812

913
const detectedHost = h.get("host");

0 commit comments

Comments
 (0)