diff --git a/apps/smartdoc/settings/base.py b/apps/smartdoc/settings/base.py index 8b4c06802..33bd31ad0 100644 --- a/apps/smartdoc/settings/base.py +++ b/apps/smartdoc/settings/base.py @@ -47,7 +47,7 @@ MIDDLEWARE = [ 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + ] JWT_AUTH = { diff --git a/apps/smartdoc/urls.py b/apps/smartdoc/urls.py index 6246f8919..a7f99c1ee 100644 --- a/apps/smartdoc/urls.py +++ b/apps/smartdoc/urls.py @@ -77,7 +77,9 @@ def page_not_found(request, exception): file = open(index_path, "r", encoding='utf-8') content = file.read() file.close() - return HttpResponse(content, status=200) + if request.path.startswith('/ui/chat/'): + return HttpResponse(content, status=200) + return HttpResponse(content, status=200, headers={'X-Frame-Options': 'DENY'}) handler404 = page_not_found diff --git a/ui/src/api/application.ts b/ui/src/api/application.ts index 0b1b60c5a..cce0add96 100644 --- a/ui/src/api/application.ts +++ b/ui/src/api/application.ts @@ -200,7 +200,7 @@ const getChatOpen: (applicaiton_id: String) => Promise> = (applicait } */ const postChatMessage: (chat_id: string, message: string) => Promise = (chat_id, message) => { - return postStream(`/api/${prefix}/chat_message/${chat_id}`, { message }) + return postStream(`/api${prefix}/chat_message/${chat_id}`, { message }) } /** diff --git a/ui/src/views/applicaiton-overview/component/EmbedDialog.vue b/ui/src/views/applicaiton-overview/component/EmbedDialog.vue index 83319cc95..db1264ca5 100644 --- a/ui/src/views/applicaiton-overview/component/EmbedDialog.vue +++ b/ui/src/views/applicaiton-overview/component/EmbedDialog.vue @@ -71,7 +71,7 @@ allow="microphone"> host: "${window.location.host}" } <\/script> -