mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #4865 from jacobbuck/empty_x_include_headers
BUG Change Requirements::include_in_response() to not add empty 'X-Include-JS' or 'X-Include-CSS' headers
This commit is contained in:
commit
a9efe4d253
@ -1148,8 +1148,10 @@ class Requirements_Backend
|
||||
$jsRequirements[] = str_replace(',', '%2C', $path);
|
||||
}
|
||||
}
|
||||
|
||||
$response->addHeader('X-Include-JS', implode(',', $jsRequirements));
|
||||
|
||||
if(count($jsRequirements)) {
|
||||
$response->addHeader('X-Include-JS', implode(',', $jsRequirements));
|
||||
}
|
||||
|
||||
foreach($this->getCSS() as $file => $params) {
|
||||
$path = $this->pathForFile($file);
|
||||
@ -1159,7 +1161,9 @@ class Requirements_Backend
|
||||
}
|
||||
}
|
||||
|
||||
$response->addHeader('X-Include-CSS', implode(',', $cssRequirements));
|
||||
if(count($cssRequirements)) {
|
||||
$response->addHeader('X-Include-CSS', implode(',', $cssRequirements));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1655,4 +1659,4 @@ interface Requirements_Minifier {
|
||||
* @return string minified content
|
||||
*/
|
||||
public function minify($content, $type, $filename);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user