import type { ResponseCookie } from "next/dist/compiled/@edge-runtime/cookies"; export const BAGISTO_GRAPHQL_API_ENDPOINT = "/api/graphql"; export const BAGISTO_REST_API_ENDPOINT = "/api"; export const GRAPHQL_URL = `${(process.env.NEXT_PUBLIC_BAGISTO_ENDPOINT || '').replace(/\/$/, '')}${BAGISTO_GRAPHQL_API_ENDPOINT}`; export const REST_API_URL = `${(process.env.NEXT_PUBLIC_BAGISTO_ENDPOINT || '').replace(/\/$/, '')}${BAGISTO_REST_API_ENDPOINT}`; export const currencyCookieOptions = { path: '/', // 该cookie对那些路径有效,/ 表示所有路径 maxAge: 60 * 60 * 24 * 365, // 过期时间 1年,到期后自动删除 sameSite: 'lax', // 第三方网站请求你的站点时,浏览器是否携带 Cookie。 secure: process.env.APP_ENV !== 'development' // true 表示这个 Cookie 是否只能通过 HTTPS 发送 } satisfies Partial; export const configHeader = [ // Security headers for all routes { source: "/:path*", headers: [ { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, //{ key: "X-Frame-Options", value: "DENY" }, { key: "X-Content-Type-Options", value: "nosniff" }, // { key: "X-XSS-Protection", value: "1; mode=block" }, // { // key: "Permissions-Policy", // value: // "camera=(), microphone=(), geolocation=(), browsing-topics=()", // }, ], }, // Cache dynamic pages - shorter cache for frequently updated content // Next.js static assets - long cache with immutable // Public folder assets - long cache ];