chore: static assets use relative paths instead of {{public_url}} #721
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: I'm not expecting this to be immediately merged, just starting a discussion around if this is something we want.
Continuing in my quest to reduce our chances of XSS by removing interpolation from our html templates, this PR removes the need for
{{public_url}}
to refer to static assets. It also places static assets underassets/
to prevent future namespace collisions between static assets and routes.One caveat: if you mount your app at
/foobar
and loadhttp://localhost:8080/foobar
, the relative URLs won't work. The index page works around this by auto-redirecting tohttp://localhost:8080/foobar/
if you loadhttp://localhost:8080/foobar
. This seems acceptable to me as a common thing submounted pages might do but I definitely wanted to get feedback on it.