Monorepo for Tangled tangled.org
856
fork

Configure Feed

Select the types of activity you want to include in your feed.

Sites serve directories without a trailing slash, breaking relative paths and links #527

open opened by sajidanwar.com

Example: https://sajidanwar.tngl.io/baseline-diagnostic-font

When serving a <path> that doesn't exist, the sites worker checks to see if <path>/index.html exists and then directly serves that. This is the case even if <path> doesn't end in a trailing slash, which is problematic with how browsers handle relative paths. In my example site above, I link to a web font CSS file at ./baseline-diagnostic-font.css, expecting to find it in the same directory as the index.html. Without the trailing slash, the browser looks it up at the root instead, breaking the font.

I looked at GitHub's behavior and they do 301 Moved Permanently redirects from "un-slashed" directories to their trailing slash versions (which then does serve index.html directly).

[deleted by author]
[deleted by author]
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 3
AT URI
at://did:plc:55mvy6od2watiacwej7srdkn/sh.tangled.repo.issue/3mlfjyglezu22