Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15434161
D19170.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
786 B
Referenced Files
None
Subscribers
None
D19170.diff
View Options
diff --git a/src/aphront/response/AphrontResponse.php b/src/aphront/response/AphrontResponse.php
--- a/src/aphront/response/AphrontResponse.php
+++ b/src/aphront/response/AphrontResponse.php
@@ -109,7 +109,14 @@
if ($cdn) {
$default = $this->newContentSecurityPolicySource($cdn);
} else {
- $default = "'self'";
+ // If an alternate file domain is not configured and the user is viewing
+ // a Phame blog on a custom domain or some other custom site, we'll still
+ // serve resources from the main site. Include the main site explicitly.
+
+ $base_uri = PhabricatorEnv::getURI('/');
+ $base_uri = $this->newContentSecurityPolicySource($base_uri);
+
+ $default = "'self' {$base_uri}";
}
$csp[] = "default-src {$default}";
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 26, 2:20 AM (2 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7679791
Default Alt Text
D19170.diff (786 B)
Attached To
Mode
D19170: Include the primary domain in the Content-Security-Policy explicitly if there's no CDN
Attached
Detach File
Event Timeline
Log In to Comment