Skip to content
Snippets Groups Projects

Issue #3450553 by kriboogh: CORS is not reflected in Ajax calls (requests are send as anonymous)

Open Issue #3450553 by kriboogh: CORS is not reflected in Ajax calls (requests are send as anonymous)
4 unresolved threads
Open Kris Booghmans requested to merge issue/drupal-3450553:3450553-cors-is-not into 11.x
4 unresolved threads

Closes #3450553

Merge request reports

Members who can merge are allowed to add commits.
Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
.gitignore 0 → 100644
1
2 .idea/
  • 170 170 ],
    171 171 ]);
    172 172 $this->assertEquals(200, $response->getStatusCode());
    173
  • 15 *
    16 * @group Http
    17 */
    18 class CorsIntegrationTest extends WebDriverTestBase {
    19
    20 /**
    21 * {@inheritdoc}
    22 */
    23 protected static $modules = ['ajax_test'];
    24
    25 /**
    26 * {@inheritdoc}
    27 */
    28 protected $defaultTheme = 'stark';
    29
    30 public function testAjaxCorsSettings() {
  • 35
    36 // Enable CORS with some default options.
    37 $cors_config['enabled'] = TRUE;
    38 $cors_config['supportsCredentials'] = FALSE;
    39
    40 $this->setContainerParameter('cors.config', $cors_config);
    41 $this->rebuildContainer();
    42
    43 // Test ajaxCrossDomain is not set by default (supportsCredentials is false).
    44 $this->drupalGet('ajax-test/dialog');
    45 $settings = $this->getDrupalSettings();
    46 $this->assertArrayHasKey('withCredentials', $settings['ajaxCrossDomain'] ?? []);
    47 $this->assertFalse($cors_config['supportsCredentials'] ?? FALSE);
    48 $this->assertFalse($settings['ajaxCrossDomain']['withCredentials'] ?? FALSE);
    49
    50 // Reset page cache
    Please register or sign in to reply
    Loading