4 ms·
When in doubt, check the spec. In this case it is in RFC 2396 "Uniform Resource Identifiers (URI): Generic Syntax" [1]. In Section 3 you find this. The forwa
by mjul 5y ago
When in doubt, check the spec.
In this case it is in RFC 2396 "Uniform Resource Identifiers (URI): Generic Syntax" [1].
In Section 3 you find this. The forward stroke ("slash") is a separator:
URI that are hierarchical in nature use the slash "/" character for separating hierarchical components.
[1] http://www.ietf.org/rfc/rfc2396.txt http://www.ietf.org/rfc/rfc2396.txt
- chrismorgan 5y ago… and? (Your answer doesn’t enlighten anything. You could possibly be saying “it says use slash as a separator, not a terminator”, but it can be quite reasonable to declare a null component at the end as a means of accessing the default resource for that “folder”. Pages often have other resources associated with them. The fact of the matter is that the folder/file divide just isn’t present in URLs, and so the answer in a situation like this is ambiguous.)
- mjul 5y agoI initially understood the prose in Section 3 like you interpret it (separator not terminator). That was a mistake. The RFC's BNF grammar is quite clearly stating that path segments may be empty, so it may end in "/". Therefore, in relation to the article, the URI RFC does indeed not offer guidance about what would be the better approach.