diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php --- a/src/aphront/configuration/AphrontApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontApplicationConfiguration.php @@ -113,11 +113,17 @@ array( $base_uri, $prod_uri, - $file_uri, ), $conduit_uris, $allowed_uris); + $cdn_routes = array( + '/res/', + '/file/data/', + '/file/xform/', + '/phame/r/', + ); + $host_match = false; foreach ($uris as $uri) { if ($host === id(new PhutilURI($uri))->getDomain()) { @@ -126,6 +132,17 @@ } } + if (!$host_match) { + if ($host === id(new PhutilURI($file_uri))->getDomain()) { + foreach ($cdn_routes as $route) { + if (strncmp($path, $route, strlen($route)) == 0) { + $host_match = true; + break; + } + } + } + } + // NOTE: If the base URI isn't defined yet, don't activate alternate // domains. if ($base_uri && !$host_match) {