> i disagree that it has to be strict by defaul...
# ktor
m
i disagree that it has to be strict by default
Do you want search engines to see duplicate pages on your website? Do you want relative links on your pages to be broken?
t
that's not decided by if it's set to strict by default
in my experience, most people (not all) want `/users/`and
/users
to map to the same handler
so i ignore trailing slashes by default, but let users configure it
b
While those 2 URLs are 2 quite different things, I can see the usefulness. On an API at least,
/users
has generally been more correct. Let's say you want to signal the result format via file extension.
/users/.json
doesn't really make sense to me
m
But
/users/.json
is a valid address! Just set your handler to
/users.json
(or
{entity}.{ext}
).
b
Right, but stripping trailing slashes wouldn’t work on that because there is no slash after
.json
. To what extent do you expect the URLs to be parsed?
v
just some insights to the discussion: when the url is a marketing-relevant url (and will be advertised via google, facebook, instagram…) those advertisers often add or remove the trailing slash. so keep in mind that you don’t have always control over the urls the user get presented…