Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(security): add x-frame-options header (#669)

Marc Klingen0c36c4166f68
diff --git a/next.config.mjs b/next.config.mjs
index f69ad66fc3..3cc2afe290 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -23,27 +23,37 @@ const nextConfig = {
output: "standalone",
async headers() {
- // Required to check authentication status from langfuse.com
- if (env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION !== undefined)
- return [
- {
- source: "/api/auth/session",
- headers: [
- {
- key: "Access-Control-Allow-Origin",
- value: "https://langfuse.com",
- },
- { key: "Access-Control-Allow-Credentials", value: "true" },
- { key: "Access-Control-Allow-Methods", value: "GET,POST" },
- {
- key: "Access-Control-Allow-Headers",
- value: "Content-Type, Authorization",
- },
- ],
- },
- ];
-
- return [];
+ return [
+ {
+ source: "/:path*",
+ headers: [
+ {
+ key: "x-frame-options",
+ value: "SAMEORIGIN",
+ },
+ ],
+ },
+ // Required to check authentication status from langfuse.com
+ ...(env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION !== undefined ?
+ [
+ {
+ source: "/api/auth/session",
+ headers: [
+ {
+ key: "Access-Control-Allow-Origin",
+ value: "https://langfuse.com",
+ },
+ { key: "Access-Control-Allow-Credentials", value: "true" },
+ { key: "Access-Control-Allow-Methods", value: "GET,POST" },
+ {
+ key: "Access-Control-Allow-Headers",
+ value: "Content-Type, Authorization",
+ },
+ ]
+ },
+ ] : []
+ )
+ ]
},
// webassembly support for @dqbd/tiktoken