Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1136 มุมมอง

When attempting to integrate the Odoo interface into my Flutter application, running on http://localhost:8000/, using an iframe, a specific error message appears in the browser: 'Refused to frame 'http://localhost:8069/' because an ancestor violates the following Content Security Policy directive: 'frame-ancestors 'self'.' How can I resolve this issue, considering that the Flutter application runs on http://localhost:8000/ and Odoo on http://localhost:8069/?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

The issue stems from the Content Security Policy (CSP), by modifying both the web_login() and web_client() methods in the following path: C:\Program Files\Odoo 17.0.20240227\server\odoo\addons\web\controllers\home.py. This worked.

 

web_client()

#response.headers['X-Frame-Options'] = 'DENY' 

web_login() 

#response.headers['X-Frame-Options'] = 'SAMEORIGIN'        #response.headers['Content-Security-Policy'] = "frame-ancestors 'self'"  

อวตาร
ละทิ้ง