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:
Damian Mooyman 2015-12-22 14:45:02 +13:00
commit a9efe4d253

View File

@ -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);
}
}