Topic on Talk:Requests for comment/Content-Security-Policy

146.255.180.29 (talkcontribs)

First off, glad it's finally implemented.

Am I off with the syntax? @Bawolff

$wgCSPHeader = [
       'default-src' => [
               'self'
       ],
       'img-src' => [
               'site.com'
       ],
       'style-src' => [
               'site1.com',
               'site2.com'
       ]
];

default-src appears to register, but not img-src nor style-src.

2A00:1CA0:1484:4D00:81B7:FB69:50D6:9793 (talkcontribs)

I had to use "'self'" so that it has single quotes in the browser:


$wgCSPHeader = [
  'default-src' => [
    "'self'"
  ]
]
Reply to "Syntax"