Ticket #43: i43resolution.diff

File i43resolution.diff, 2.3 KB (added by julian.reschke@…, 11 years ago)

an attempt to describe the resolution algorithm

  • p2-semantics.xml

     3962<section title="Base Fragment Aware Relative Resolution">
     3964  <xref target="RFC3986" x:fmt="of" x:sec="5.2"/> defines the Relative Resolution
     3965  of a URI reference against a Base URI. That algorithm however does not take a
     3966  fragment identifier on the Base URI into account.
     3969  However in some cases, as when following a redirect from a URI "Base" based
     3970  on a Location header field containing the URI reference "R", it can be
     3971  necessary to preserve a fragment identifier present on "Base". The algorithm described below does this:
     3974  Given a URI reference "R" and a base URI "Base", to transform R into its
     3975  target URI "T":
     3978  (1) Pre-parse the Base URI as defined in <xref target="RFC3986" x:fmt="of" x:sec="5.2.1"/>.
     3981  (2) Transform references as defined in <xref target="RFC3986" x:fmt="of" x:sec="5.2.2"/>.
     3982  If the T.fragment is undefined and Base.fragment is defined, then set
     3983  T.fragment to Base.fragment:
     3985<figure><artwork type="text/plain">
     3986  if defined(Base.fragment) and not(defined(T.fragment)) then
     3987    T.fragment = Base.fragment;
     3988  endif;
     3991  (3) Merge paths as defined in <xref target="RFC3986" x:fmt="of" x:sec="5.2.3"/>.
     3994  (4) Remove dot segments as defined in <xref target="RFC3986" x:fmt="of" x:sec="5.2.4"/>.
     3997  (5) Finally, recompose the components as defined in <xref target="RFC3986" x:fmt="of" x:sec="5.3"/>.
     3999<section title="Examples">
     4001  Starting with a Base URI of "http://host/path1#f1":
     4004  <ttcol>R</ttcol>
     4005  <ttcol>T (after RFC 3986 Relative Resolution)</ttcol>
     4006  <ttcol>T (after Base Fragment Aware Relative Resolution)</ttcol>
     4008  <c>/path2</c>
     4009  <c>http://host/path2</c>
     4010  <c>http://host/path2#f1</c>
     4012  <c>/path2#f2</c>
     4013  <c>http://host/path2#f2</c>
     4014  <c>http://host/path2#f2</c>
    39624020<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
    39644022  This document takes over the Status Code Registry, previously defined