Commit 14b3f0b8 authored by catch's avatar catch
Browse files

Issue #3260401 by idebr, Spokje, Akram Khan, mcdruid, longwave, alexpott:...

Issue #3260401 by idebr, Spokje, Akram Khan, mcdruid, longwave, alexpott: Google is abandoning FLoC - so remove the header
parent 274f8d91
Loading
Loading
Loading
Loading
−15
Changes for core/assets/scaffold/files/default.settings.php: 0 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -616,21 +616,6 @@
# ini_set('pcre.backtrack_limit', 200000);
# ini_set('pcre.recursion_limit', 200000);

/**
 * Add Permissions-Policy header to disable Google FLoC.
 *
 * By default, Drupal sends the 'Permissions-Policy: interest-cohort=()' header
 * to disable Google's Federated Learning of Cohorts feature, introduced in
 * Chrome 89.
 *
 * See https://en.wikipedia.org/wiki/Federated_Learning_of_Cohorts for more
 * information about FLoC.
 *
 * If you don't wish to disable FLoC in Chrome, you can set this value
 * to FALSE.
 */
# $settings['block_interest_cohort'] = TRUE;

/**
 * Configuration overrides.
 *
−5
Changes for core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -131,11 +131,6 @@ public function onRespond(ResponseEvent $event) {
    $response->headers->set('X-Content-Type-Options', 'nosniff', FALSE);
    $response->headers->set('X-Frame-Options', 'SAMEORIGIN', FALSE);

    // Add a Permissions-Policy header to block Federated Learning of Cohorts.
    if (Settings::get('block_interest_cohort', TRUE) && !$response->headers->has('Permissions-Policy')) {
      $response->headers->set('Permissions-Policy', 'interest-cohort=()');
    }

    // If the current response isn't an implementation of the
    // CacheableResponseInterface, we assume that a Response is either
    // explicitly not cacheable or that caching headers are already set in
+4
Changes for core/lib/Drupal/Core/Site/Settings.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@ final class Settings {
      'replacement' => 'twig_sandbox_allowed_prefixes',
      'message' => 'The "twig_sandbox_whitelisted_prefixes" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_prefixes" instead. See https://www.drupal.org/node/3162897.',
    ],
    'block_interest_cohort' => [
      'replacement' => '',
      'message' => 'The "block_interest_cohort" setting is deprecated in drupal:9.5.0. This setting should be removed from the settings file, since its usage has been removed. See https://www.drupal.org/node/3320787.',
    ],
  ];

  /**
−83

File deleted.

+4
Changes for core/tests/Drupal/Tests/Core/Site/SettingsTest.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -322,6 +322,10 @@ public function providerTestRealDeprecatedSettings(): array {
        'twig_sandbox_whitelisted_prefixes',
        'The "twig_sandbox_whitelisted_prefixes" setting is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use "twig_sandbox_allowed_prefixes" instead. See https://www.drupal.org/node/3162897.',
      ],
      [
        'block_interest_cohort',
        'The "block_interest_cohort" setting is deprecated in drupal:9.5.0. This setting should be removed from the settings file, since its usage has been removed. See https://www.drupal.org/node/3320787.',
      ],
    ];
  }

Loading