7

Im making a Chatapp project in Django. I implemented channels and websockets to send and receive message and this worked when i tested using two differents windows in the same browser (one of them in incognito mode), but when i try to test it using another browser i get the following error:

Cross Origin Opener Policy error

I tried to solve implementing django corsheaders with the following configuration:

Corsheaders app installation

Corsheaders middleware

Corsheaders settings

(I know that setting all origins to true its not recommendable but it's just for testing purpouses)

Lithios23
  • 73
  • 1
  • 1
  • 5

1 Answers1

14

In settings.py, you have to set SECURE_CROSS_ORIGIN_OPENER_POLICY = None

Default value is same-origin

https://django.readthedocs.io/en/stable/ref/settings.html#std-setting-SECURE_CROSS_ORIGIN_OPENER_POLICY

https://adamj.eu/tech/2021/05/01/how-to-set-coep-coop-corp-security-headers-in-django/

JamoBox
  • 764
  • 9
  • 23
Dan Verman
  • 156
  • 1
  • 4