Draft: Replace X-Frame-Ancestors with Content-Security-Policy
3 unresolved threads
3 unresolved threads
Closes #2513356
Merge request reports
Activity
added 1 commit
- d7041528 - Replace X-Frame-Ancestors with Content-Security-Policy
added 400 commits
-
4962616b...5f69735b - 398 commits from branch
project:11.x
- 87c396fe - Replace X-Frame-Ancestors with Content-Security-Policy
- 22932605 - Add example csp to default.services.yml
-
4962616b...5f69735b - 398 commits from branch
added 1 commit
- cda9dd54 - Test replacing X-Frame-Options with Content-Security-Policy
- Resolved by Geoff Appleby
- Resolved by Geoff Appleby
167 168 $request = $this->createMock(Request::class); 169 $response = $this->createMock(Response::class); 170 $response->headers = new ResponseHeaderBag(); 171 $event = new ResponseEvent($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response); 172 173 $finishSubscriber->onRespond($event); 174 175 $this->assertEquals(["default-src 'self'"], $response->headers->all('Content-Security-Policy-Report-Only')); 176 $this->assertEquals(["script-src * 'unsafe-inline'"], $response->headers->all('Content-Security-Policy')); 177 } 178 179 /** 180 * Data Provider for testing conversion of X-Frame-Options to CSP header. 181 * 182 * @todo Remove in Drupal 11.0.0. See https://www.drupal.org/project/drupal/issues/2513356 Believe we need to use @deprecated vs @todo
I don't think the deprecated annotation makes sense for test methods, since it's just a cleanup note and not an indication that the method shouldn't be called. The link should probably be changed to a postponed issue for the code/deprecation removal in 12.0.0 once it's created, but I wanted to make sure the overall approach of the PR is accepted first.
changed this line in version 8 of the diff
- Resolved by Geoff Appleby
195 ], 196 'deny' => [ 197 'DENY', 198 "script-src * 'unsafe-inline'; object-src 'none'; frame-ancestors 'none'", 199 ], 200 'domain' => [ 201 'ALLOW-FROM https://example.com', 202 "script-src * 'unsafe-inline'; object-src 'none'; frame-ancestors https://example.com", 203 ], 204 ]; 205 } 206 207 /** 208 * X-Frame-Options should be converted to a CSP header. 209 * 210 * @todo Remove in Drupal 11.0.0. See https://www.drupal.org/project/drupal/issues/2513356 Believe will have to use @deprecated vs @todo
changed this line in version 8 of the diff
- Resolved by Geoff Appleby
added 456 commits
-
fda3fe66...a9b0fa6d - 455 commits from branch
project:11.x
- d763e8e1 - Replace X-Frame-Ancestors with Content-Security-Policy
-
fda3fe66...a9b0fa6d - 455 commits from branch
Please register or sign in to reply