mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Format for SS3 using tabs instead of spaces
This commit is contained in:
parent
f7c270a3ba
commit
fc5e584201
@ -358,10 +358,10 @@ class HTTP {
|
||||
|
||||
// To do: User-Agent should only be added in situations where you *are* actually
|
||||
// varying according to user-agent.
|
||||
$vary = $config->get('HTTP', 'vary');
|
||||
if ($vary && strlen($vary)) {
|
||||
$responseHeaders['Vary'] = $vary;
|
||||
}
|
||||
$vary = $config->get('HTTP', 'vary');
|
||||
if ($vary && strlen($vary)) {
|
||||
$responseHeaders['Vary'] = $vary;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($body) {
|
||||
|
@ -48,28 +48,28 @@ class HTTPTest extends FunctionalTest {
|
||||
|
||||
|
||||
public function testConfigVary() {
|
||||
$body = "<html><head></head><body><h1>Mysite</h1></body></html>";
|
||||
$body = "<html><head></head><body><h1>Mysite</h1></body></html>";
|
||||
$response = new SS_HTTPResponse($body, 200);
|
||||
Config::inst()->update('Director', 'environment_type', 'live');
|
||||
HTTP::set_cache_age(30);
|
||||
Config::inst()->update('Director', 'environment_type', 'live');
|
||||
HTTP::set_cache_age(30);
|
||||
HTTP::add_cache_headers($response);
|
||||
|
||||
$v = $response->getHeader('Vary');
|
||||
$v = $response->getHeader('Vary');
|
||||
$this->assertNotEmpty($v);
|
||||
|
||||
$this->assertContains("Cookie", $v);
|
||||
$this->assertContains("X-Forwarded-Protocol", $v);
|
||||
$this->assertContains("User-Agent", $v);
|
||||
$this->assertContains("Accept", $v);
|
||||
$this->assertContains("Cookie", $v);
|
||||
$this->assertContains("X-Forwarded-Protocol", $v);
|
||||
$this->assertContains("User-Agent", $v);
|
||||
$this->assertContains("Accept", $v);
|
||||
|
||||
Config::inst()->update('HTTP', 'vary', '');
|
||||
Config::inst()->update('HTTP', 'vary', '');
|
||||
|
||||
$response = new SS_HTTPResponse($body, 200);
|
||||
HTTP::add_cache_headers($response);
|
||||
$response = new SS_HTTPResponse($body, 200);
|
||||
HTTP::add_cache_headers($response);
|
||||
|
||||
$v = $response->getHeader('Vary');
|
||||
$v = $response->getHeader('Vary');
|
||||
$this->assertEmpty($v);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests {@link HTTP::getLinksIn()}
|
||||
|
Loading…
x
Reference in New Issue
Block a user