Issue #3450553 by kriboogh: CORS is not reflected in Ajax calls (requests are send as anonymous)
4 unresolved threads
Closes #3450553
Merge request reports
Activity
- .gitignore 0 → 100644
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