diff --git a/config.json b/config.json.bak similarity index 100% rename from config.json rename to config.json.bak diff --git a/src/app/api/analytics/script/route.ts b/src/app/api/analytics/script/route.ts index 81748a7..46902c0 100644 --- a/src/app/api/analytics/script/route.ts +++ b/src/app/api/analytics/script/route.ts @@ -5,7 +5,14 @@ import { NextRequest, NextResponse } from 'next/server' // data-domain attribute'u ile domain belirtilir export async function GET(req: NextRequest) { - const panelUrl = req.nextUrl.origin + const forwardedHost = req.headers.get('x-forwarded-host') + const hostHeader = req.headers.get('host') + const host = forwardedHost || hostHeader || req.nextUrl.host + + const forwardedProto = req.headers.get('x-forwarded-proto') + const protocol = forwardedProto || (host.includes('localhost') ? 'http' : 'https') + + const panelUrl = `${protocol}://${host}` const script = ` (function() {