Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
// Response fields that are useful on published sites. Platform-owned fields are
// deliberately excluded. Names are suggestions, not an allowlist; the shared
// response-header schema rejects forbidden customizations even when typed manually.
export const responseHeaderNames = [
"Accept-CH",
"Accept-Patch",
"Accept-Post",
"Accept-Ranges",
"Access-Control-Allow-Credentials",
"Access-Control-Allow-Headers",
"Access-Control-Allow-Methods",
"Access-Control-Allow-Origin",
"Access-Control-Expose-Headers",
"Access-Control-Max-Age",
"Age",
"Allow",
"Alt-Svc",
"Cache-Control",
"Cache-Status",
"CDN-Cache-Control",
"Clear-Site-Data",
"Content-Disposition",
"Content-Digest",
"Content-Language",
"Content-Location",
"Content-Security-Policy",
"Content-Security-Policy-Report-Only",
"Content-Type",
"Cross-Origin-Embedder-Policy",
"Cross-Origin-Embedder-Policy-Report-Only",
"Cross-Origin-Opener-Policy",
"Cross-Origin-Opener-Policy-Report-Only",
"Cross-Origin-Resource-Policy",
"Critical-CH",
"ETag",
"Expires",
"Last-Modified",
"Link",
"Location",
"NEL",
"Origin-Agent-Cluster",
"Permissions-Policy",
"Priority",
"Proxy-Status",
"Referrer-Policy",
"Reporting-Endpoints",
"Repr-Digest",
"Retry-After",
"Server",
"Server-Timing",
"Service-Worker-Allowed",
"SourceMap",
"Speculation-Rules",
"Supports-Loading-Mode",
"Timing-Allow-Origin",
"Vary",
"WWW-Authenticate",
"X-Frame-Options",
] as const;
const responseHeaderValues: Record<string, readonly string[]> = {
"accept-ranges": ["bytes", "none"],
"access-control-allow-credentials": ["true"],
"access-control-allow-headers": ["Content-Type", "Authorization"],
"access-control-allow-methods": [
"GET, HEAD, POST",
"GET, POST, PUT, DELETE, OPTIONS",
],
"access-control-allow-origin": ["*"],
"access-control-expose-headers": ["Content-Disposition", "ETag"],
"access-control-max-age": ["600", "86400"],
"cache-control": [
"no-store",
"no-cache",
"private, no-store",
"public, max-age=3600",
"public, max-age=31536000, immutable",
],
"cdn-cache-control": ["no-store", "public, max-age=3600"],
"clear-site-data": ['"cache"', '"cookies"', '"storage"', '"*"'],
"content-disposition": ["inline", "attachment"],
"content-security-policy": [
"frame-ancestors 'self'",
"frame-ancestors 'none'",
"default-src 'self'",
],
"content-security-policy-report-only": ["default-src 'self'"],
"content-type": [
"text/html; charset=utf-8",
"text/plain; charset=utf-8",
"application/json",
"application/xml",
],
"cross-origin-embedder-policy": [
"unsafe-none",
"require-corp",
"credentialless",
],
"cross-origin-embedder-policy-report-only": [
"require-corp",
"credentialless",
],
"cross-origin-opener-policy": [
"unsafe-none",
"same-origin",
"same-origin-allow-popups",
"noopener-allow-popups",
],
"cross-origin-opener-policy-report-only": [
"same-origin",
"same-origin-allow-popups",
],
"cross-origin-resource-policy": ["same-origin", "same-site", "cross-origin"],
"origin-agent-cluster": ["?1", "?0"],
"permissions-policy": ["geolocation=()", "camera=()", "microphone=()"],
"referrer-policy": [
"strict-origin-when-cross-origin",
"no-referrer",
"no-referrer-when-downgrade",
"origin",
"origin-when-cross-origin",
"same-origin",
"strict-origin",
"unsafe-url",
],
"service-worker-allowed": ["/"],
"supports-loading-mode": ["credentialed-prerender"],
"timing-allow-origin": ["*"],
vary: ["Accept-Encoding", "Origin", "*"],
"x-frame-options": ["SAMEORIGIN", "DENY"],
};
export const getResponseHeaderName = (name: string) =>
responseHeaderNames.find(
(standardName) => standardName.toLowerCase() === name.toLowerCase()
);
export const getResponseHeaderValueSuggestions = (name: string) =>
responseHeaderValues[name.trim().toLowerCase()] ?? [];