]> cat aescling's git repositories - mastodon.git/commitdiff
Fix assets loading when WEB_DOMAIN ≠ LOCAL_DOMAIN (#6319)
authorThibG <thib@sitedethib.com>
Sun, 21 Jan 2018 12:22:31 +0000 (13:22 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 21 Jan 2018 12:22:31 +0000 (13:22 +0100)
Since 872a0d5bd801c998d911f7da582a60d2f714a710, assets URL are absolute and
not relative. Unfortunately, the domain used to build such URLs is the wrong
one: LOCAL_DOMAIN, and not WEB_DOMAIN, where the assets are stored.

config/webpack/configuration.js

index 26747e76b37a50e3edaa8c69de0b02fbdb1a4bf7..07af743f71feb9d9ea7aba905259dae24b87a828 100644 (file)
@@ -27,7 +27,7 @@ function formatPublicPath(host = '', path = '') {
 
 const output = {
   path: resolve('public', settings.public_output_path),
-  publicPath: formatPublicPath(env.ASSET_HOST || env.LOCAL_DOMAIN, settings.public_output_path),
+  publicPath: formatPublicPath(env.ASSET_HOST || env.WEB_DOMAIN || env.LOCAL_DOMAIN, settings.public_output_path),
 };
 
 module.exports = {