summaryrefslogtreecommitdiff
path: root/lib/forms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/forms')
-rw-r--r--lib/forms/services.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/forms/services.ts b/lib/forms/services.ts
index ff21626c..a1bbf003 100644
--- a/lib/forms/services.ts
+++ b/lib/forms/services.ts
@@ -1,6 +1,7 @@
// lib/forms/services.ts
"use server";
+import { headers } from "next/headers";
import path from "path";
import fs from "fs/promises";
import { v4 as uuidv4 } from "uuid";
@@ -805,3 +806,12 @@ export async function uploadReportTemp(
});
}
}
+
+export const getOrigin = async ():Promise<string> => {
+ const headersList = await headers();
+ const host = headersList.get("host");
+ const proto = headersList.get("x-forwarded-proto") || "http"; // 기본값은 http
+ const origin = `${proto}://${host}`;
+
+ return origin;
+};