CommunitySolidServer / CommunitySolidServer

An open and modular implementation of the Solid specifications

Home Page:https://communitysolidserver.github.io/CommunitySolidServer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide option to check hostname for static assets

joachimvh opened this issue · comments

Feature description

In CommunitySolidServer/Recipes#31 it was discovered that there is an issue when using the init/static-root import when using subdomains for pods. The static page would also be shown at the pod roots as the StaticAssetHandler only takes the relative URL into account when deciding if it should return a resource. This was not intended behaviour for the static root and also causes the current page to not work correctly as it contains relative URLs for the account API which do not work when starting from a subdomain.

Always checking the hostname for all static resources is not a solution as it breaks the HTML representation of containers, as those depend on the static stylesheet.

A solution would be to indicate for each entry if the hostname should be taken into account or not. The StaticAssetHandler already takes the base URL of the server as input so this would not be a breaking change for the class.

The configuration generator should also be updated to not allow this combination.