Closed gustavopch closed 8 months ago
The problem is here: https://github.com/sergiodxa/remix-hono/blob/582c0756d16971bf65ab5f151fa9d56bbb313c1b/src/trailing-slash.ts#L20-L23
When you're at /foo/, it strips down to /foo. But when you're at /, it can't be stripped. This should fix it:
/foo/
/foo
/
-if (!options?.enabled && hasTrailingSlash) { +if (!options?.enabled && hasTrailingSlash && url.pathname !== '/') { url.pathname = url.pathname.slice(0, -1); return c.redirect(url.toString()); }
Nice catch!
The problem is here: https://github.com/sergiodxa/remix-hono/blob/582c0756d16971bf65ab5f151fa9d56bbb313c1b/src/trailing-slash.ts#L20-L23
When you're at
/foo/
, it strips down to/foo
. But when you're at/
, it can't be stripped. This should fix it: