pushup icon indicating copy to clipboard operation
pushup copied to clipboard

Trailing slash or no

Open paulsmith opened this issue 3 years ago • 3 comments

#30 brought up how handling a trailing slash should work. Should it be the default to have a trailing slash in URL paths, and redirect if a request would have matched but for the missing trailing slash, like for example how it works in Django? The current Pushup way is to match routes without a trailing slash, and then if one is present, redirect to one that would match with it removed.

Django way:

request /foo redirects to /foo/

(Current) Pushup way:

request /foo/ redirects to /foo

paulsmith avatar Aug 27 '22 02:08 paulsmith

There's of course a third way: /foo and /foo/ both serve indexes and do no redirection. That's the way ls works, which is pretty much the way I think of the path - as a file system path at a remote server

llimllib avatar Aug 27 '22 02:08 llimllib

Was this closed by 7334e58f148c4443888704daf19d7e7b4233267c?

llimllib avatar Aug 31 '22 12:08 llimllib

It fixed the current problem of going to a route and getting a 404 because of a trailing slash, but the larger design decision isn't made. I think I'm leaning your 3rd way.

paulsmith avatar Aug 31 '22 12:08 paulsmith