Skip to Content
Menu
This question has been flagged
1 Reply
1132 Views

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/?

Avatar
Discard
Author Best Answer

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'"  

Avatar
Discard