mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 19:26:02 +08:00
chore: support other webapps embedded in iframe (#18877)
This commit is contained in:
parent
19f2a74ba8
commit
d91828dd90
@ -6,7 +6,7 @@ const NECESSARY_DOMAIN = '*.sentry.io http://localhost:* http://127.0.0.1:* http
|
|||||||
const wrapResponseWithXFrameOptions = (response: NextResponse, pathname: string) => {
|
const wrapResponseWithXFrameOptions = (response: NextResponse, pathname: string) => {
|
||||||
// prevent clickjacking: https://owasp.org/www-community/attacks/Clickjacking
|
// prevent clickjacking: https://owasp.org/www-community/attacks/Clickjacking
|
||||||
// Chatbot page should be allowed to be embedded in iframe. It's a feature
|
// Chatbot page should be allowed to be embedded in iframe. It's a feature
|
||||||
if (process.env.NEXT_PUBLIC_ALLOW_EMBED !== 'true' && !pathname.startsWith('/chat'))
|
if (process.env.NEXT_PUBLIC_ALLOW_EMBED !== 'true' && !pathname.startsWith('/chat') && !pathname.startsWith('/workflow') && !pathname.startsWith('/completion'))
|
||||||
response.headers.set('X-Frame-Options', 'DENY')
|
response.headers.set('X-Frame-Options', 'DENY')
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
Loading…
x
Reference in New Issue
Block a user