Issue with :base-url that has a context path #9

magnars opened this Issue Dec 28, 2013 · 0 comments


None yet

1 participant


When you're serving assets from a CDN, you can add a :base-url to each asset. This URL will be added to links to the assets. Like this:

{:path "/scripts/code.js"
 :base-url ""}

When you call ( request "/scripts/code.js") you get

The problem arises in CSS files. They too link to assets, but unless you explicitly update their :contents, they won't use the :base-url. This isn't a problem in the example above. Since they're using absolute URLs, they'll use the base URL as long as they're served from there.

However, if the base URL contains a context path: - then the absolute paths in CSS fail.

In that case, we either need to update the contents of all CSS files with the base URL. Or we could use relative paths instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment