public function SecKitTestCase::testOriginAllowsSpecifiedSourceMultiWhitelist in Security Kit 7
Tests HTTP Origin allows requests from the specified source, with multiple values in the whitelist.
File
- ./
seckit.test, line 410 - Tests for Security Kit module.
Class
- SecKitTestCase
- Functional tests for Security Kit.
Code
public function testOriginAllowsSpecifiedSourceMultiWhitelist() {
$form = array(
'seckit_csrf[origin]' => TRUE,
'seckit_csrf[origin_whitelist]' => 'http://www.example.com, https://www.example.com, https://example.com:8080',
);
$this
->drupalPost('admin/config/system/seckit', $form, t('Save configuration'));
$this
->drupalPost('admin/config/system/seckit', $form, t('Save configuration'), array(), array(
'Origin: https://www.example.com',
));
$this
->assertResponse(200, t('Whitelisted request is allowed.'));
}