Feel free to visit https://sales-community-staging.rainmakers.co/sales-community/ to see issue. No guarantees on it being up forever.
I believe this is because it is not adding /sales-community to the url.
Let me know if providing app.yml or nginx.conf would be helpful.
This is on version: tests-passed.
Tried version: stable to fix, doesn’t compile on docker atm (mentioned in some other bug report I saw earlier, I was starting fresh, not downgrading)
Yes. Everything else works (posting, emails, avatar uploads, https, etc). All other resources have proper /sales-community subfolder URLs (as shown in the pic). Just the SVG broken.
Yeah, so the issue is not with CSP because the URL is just wrong, it’s apparently not being prefixed with the subfolder path, I think it needs to be added here ?
We do have all the logic in place for SVG sprites in subfolder scenarios, and it’s used successfully by a number of sites. In this case, we’ve hit a very specific edge case. Checking the key variables in @vkozyrev’s site (on the browser console)
Looks good. Now, when we load the SVG sprite sheet, we use loadScript, which in turn calls Discourse.getURL. This function is responsible for adding the subfolder prefix. Trying that out:
A little more digging turns up this line inside getUrl
if (url.indexOf(Discourse.BaseUri) !== -1) return url;
Or, in english, “if the URL already contains the subfolder prefix, give up”. So the issue here is that @vkozyrev’s subfolder prefix (/sales-community) is included in the middle of the SVG sprite sheet URL
I’ve made the check more specific, so it only checks for the subfolder prefix at the beginning of the URL:
Although it does make me think of other potential issues… e.g. if someone wanted their subfolder prefix to be /t or /about, or any other URL which we use in Discourse
This is an amazing edge case . I do Rails (api-mode only) development, glad I didn’t go too far down the rabbit hole, I would have gotten lost in the client code.
In case you are curious, I have a proxy in front of this, so the sales-community subdomain is hidden from the users, they will just see the /sales-community in front of our main site’s URL. Main site is on heroku, so I can’t have a single nginx instance routing it all.