Re:Trailing slashes on URLs: Contentious or settled?
by dotancohen on Thursday January 27, 2022 @03:22AM
(#30097728)
Is that per standard, or the result of an implementation detail in Go that might be different in e.g. Python?
[ Parent
| on HN ]
Re:Trailing slashes on URLs: Contentious or settled?
by shellac on Thursday January 27, 2022 @04:28AM
(#30098201)
Part of the URI standard:
return a string consisting of the reference's path component
appended to all but the last segment of the base URI's path (i.e.,
excluding any characters after the right-most "/" in the base URI
path, or excluding the entire base URI path if it does not contain
any "/" characters
https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.3
Re:Trailing slashes on URLs: Contentious or settled?
by hn_throwaway_99 on Thursday January 27, 2022 @03:53AM
(#30097949)
It's a client-side thing, not a server-side thing. That is, if you have a resource (like an href to another page) in your html, and that link is a relative link, the full URL that your browser ends up requesting depends on whether there is a trailing slash or not, because "relative" is relative to the current URL's directory, and what is considered the current directory differs depending on the presence of a trailing slash.