RFC Errata
RFC 3986, "Uniform Resource Identifier (URI): Generic Syntax", January 2005
Note: This RFC has been updated by RFC 6874, RFC 7320, RFC 8820
Source of RFC: IETF - NON WORKING GROUPArea Assignment: app
Errata ID: 4547
Status: Reported
Type: Technical
Publication Format(s) : TEXT
Reported By: siva elango ramaswamy
Date Reported: 2015-12-01
Section 5.4.2 says:
5.4.2. Abnormal Examples Although the following abnormal examples are unlikely to occur in normal practice, all URI parsers should be capable of resolving them consistently. Each example uses the same base as that above. Parsers must be careful in handling cases where there are more ".." segments in a relative-path reference than there are hierarchical levels in the base URI's path. Note that the ".." syntax cannot be used to change the authority component of a URI. "../../../g" = "http://a/g" "../../../../g" = "http://a/g"
It should say:
5.4.2. Abnormal Examples Although the following abnormal examples are unlikely to occur in normal practice, all URI parsers should be capable of resolving them consistently. Each example uses the same base as that above. Parsers must be careful in handling cases where there are more ".." segments in a relative-path reference than there are hierarchical levels in the base URI's path. Note that the ".." syntax cannot be used to change the authority component of a URI. "../../../g" = "http://a/../g" "../../../../g" = "http://a/../../g"
Notes:
The example which was taken from RFC 1808 had proper resolved URL ( 5.2 ).
As the base URL has two levels ( http://a/b/c/ ) and if the relative url's have two ".." segments then from the resolved URI both the hierarchical levels can be removed to form the resolved URL, as below:
../../g = http://a/g
and if there are more ".." segments than hierarchical level in base URI's path... then the number of ".." segments that doesn't have corresponding segments in base URI should be left as is in the resolved URI, like below
"../../../g" = "http://a/../g"