chore: anvil.it.com → inouter.com
Some checks failed
TypeScript CI / build (push) Has been cancelled
Some checks failed
TypeScript CI / build (push) Has been cancelled
This commit is contained in:
@@ -19,7 +19,7 @@ const ContactFormBodySchema = z.object({
|
|||||||
* CORS 헤더 생성
|
* CORS 헤더 생성
|
||||||
*/
|
*/
|
||||||
function getCorsHeaders(env: Env): Record<string, string> {
|
function getCorsHeaders(env: Env): Record<string, string> {
|
||||||
const allowedOrigin = env.HOSTING_SITE_URL || 'https://hosting.anvil.it.com';
|
const allowedOrigin = env.HOSTING_SITE_URL || 'https://hosting.inouter.com';
|
||||||
return {
|
return {
|
||||||
'Access-Control-Allow-Origin': allowedOrigin,
|
'Access-Control-Allow-Origin': allowedOrigin,
|
||||||
'Access-Control-Allow-Methods': 'POST, OPTIONS',
|
'Access-Control-Allow-Methods': 'POST, OPTIONS',
|
||||||
@@ -37,7 +37,7 @@ function getCorsHeaders(env: Env): Record<string, string> {
|
|||||||
async function handleContactForm(request: Request, env: Env): Promise<Response> {
|
async function handleContactForm(request: Request, env: Env): Promise<Response> {
|
||||||
// CORS 헤더 생성
|
// CORS 헤더 생성
|
||||||
const corsHeaders = getCorsHeaders(env);
|
const corsHeaders = getCorsHeaders(env);
|
||||||
const allowedOrigin = env.HOSTING_SITE_URL || 'https://hosting.anvil.it.com';
|
const allowedOrigin = env.HOSTING_SITE_URL || 'https://hosting.inouter.com';
|
||||||
|
|
||||||
// Origin 헤더 검증 (curl 우회 방지)
|
// Origin 헤더 검증 (curl 우회 방지)
|
||||||
const origin = request.headers.get('Origin');
|
const origin = request.headers.get('Origin');
|
||||||
@@ -119,7 +119,7 @@ export const contactRouter = new Hono<{ Bindings: Env }>();
|
|||||||
// CORS middleware for /contact endpoint
|
// CORS middleware for /contact endpoint
|
||||||
contactRouter.use('/*', cors({
|
contactRouter.use('/*', cors({
|
||||||
origin: (origin, c) => {
|
origin: (origin, c) => {
|
||||||
const allowedOrigin = c.env.HOSTING_SITE_URL || 'https://hosting.anvil.it.com';
|
const allowedOrigin = c.env.HOSTING_SITE_URL || 'https://hosting.inouter.com';
|
||||||
return origin === allowedOrigin ? origin : null;
|
return origin === allowedOrigin ? origin : null;
|
||||||
},
|
},
|
||||||
allowMethods: ['POST', 'OPTIONS'],
|
allowMethods: ['POST', 'OPTIONS'],
|
||||||
|
|||||||
Reference in New Issue
Block a user