mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Serve .eot and .ttf through Celerity
Summary: D9153 fixed half of this, but exposed another issue, which is that we don't actually serve ".eot" and ".ttf" through Celerity right now. Make sure we include them in the routes. Test Plan: - Downloaded CSS, JS, TTF, EOT, WOFF, JPG, etc., through Celerity. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9154
This commit is contained in:
parent
404cc16c88
commit
1ec21dc81d
2 changed files with 7 additions and 3 deletions
|
@ -27,12 +27,16 @@ class AphrontDefaultApplicationConfiguration
|
|||
}
|
||||
|
||||
protected function getResourceURIMapRules() {
|
||||
$extensions = CelerityResourceController::getSupportedResourceTypes();
|
||||
$extensions = array_keys($extensions);
|
||||
$extensions = implode('|', $extensions);
|
||||
|
||||
return array(
|
||||
'/res/' => array(
|
||||
'(?:(?P<mtime>[0-9]+)T/)?'.
|
||||
'(?P<library>[^/]+)/'.
|
||||
'(?P<hash>[a-f0-9]{8})/'.
|
||||
'(?P<path>.+\.(?:css|js|jpg|png|swf|gif|woff))'
|
||||
'(?P<path>.+\.(?:'.$extensions.'))'
|
||||
=> 'CelerityPhabricatorResourceController',
|
||||
),
|
||||
);
|
||||
|
|
|
@ -28,7 +28,7 @@ abstract class CelerityResourceController extends PhabricatorController {
|
|||
}
|
||||
|
||||
$type = CelerityResourceTransformer::getResourceType($path);
|
||||
$type_map = $this->getSupportedResourceTypes();
|
||||
$type_map = self::getSupportedResourceTypes();
|
||||
|
||||
if (empty($type_map[$type])) {
|
||||
throw new Exception("Only static resources may be served.");
|
||||
|
@ -88,7 +88,7 @@ abstract class CelerityResourceController extends PhabricatorController {
|
|||
return $this->makeResponseCacheable($response);
|
||||
}
|
||||
|
||||
protected function getSupportedResourceTypes() {
|
||||
public static function getSupportedResourceTypes() {
|
||||
return array(
|
||||
'css' => 'text/css; charset=utf-8',
|
||||
'js' => 'text/javascript; charset=utf-8',
|
||||
|
|
Loading…
Reference in a new issue