Skip to content

trailing slash removed when navigating #733

@wighawag

Description

@wighawag

Describe the bug
I would like my path to end up with a trailing slash.
Currently with these lines, svelte kit always remove it :

// remove trailing slashes
if (location.pathname.endsWith('/') && location.pathname !== '/') {
history.replaceState({}, '', `${location.pathname.slice(0, -1)}${location.search}`);
}

Expected behavior
This behavior should at least be configurable.

Having a trailing slash is important to me as ipfs gateways append it anyway and so without being able to keep the trailing slash, there is a different behaviour between SPA navigation and navigation through request.

Plus it cause issue to calculate relative path as without slash the resource is now considered to be in the parent folder

I think trailing slash are more accurate in that regard since on a static website, the corresponding underlying index.html file is in its own folder.

Severity
This is a blocker for me that deploy website on ipfs

I am working on a ipfs adapter to support ipfs properly and I am currently stuck with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions