Changeset 2075
- Timestamp:
- 01/01/13 01:58:12 (10 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p2-semantics.html
r2074 r2075 2918 2918 </p> 2919 2919 <div id="rfc.figure.u.51"></div><pre class="inline"><span id="rfc.iref.g.56"></span> <a href="#header.location" class="smpl">Location</a> = <a href="#imported.abnf" class="smpl">URI-reference</a> 2920 </pre><p id="rfc.section.7.1.2.p.3">The field value consists of a single URI-reference. When it has the form of a relative reference (<a href="#RFC3986" id="rfc.xref.RFC3986.2"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-4.2">Section 4.2</a>), the final value is computed by resolving it against the effective request URI (<a href="#RFC3986" id="rfc.xref.RFC3986.3"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-5">Section 5</a>). If the original URI, as navigated to by the user agent, contains a fragment identifier, and the Location value does not, 2921 then the original URI's fragment identifier is appended to the Location value. 2920 </pre><p id="rfc.section.7.1.2.p.3">The field value consists of a single URI-reference. When it has the form of a relative reference (<a href="#RFC3986" id="rfc.xref.RFC3986.2"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-4.2">Section 4.2</a>), the final value is computed by resolving it against the effective request URI (<a href="#RFC3986" id="rfc.xref.RFC3986.3"><cite title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</cite></a>, <a href="http://tools.ietf.org/html/rfc3986#section-5">Section 5</a>). 2922 2921 </p> 2923 2922 <p id="rfc.section.7.1.2.p.4">For <a href="#status.201" class="smpl">201 (Created)</a> responses, the Location value refers to the primary resource created by the request. For <a href="#status.3xx" class="smpl">3xx (Redirection)</a> responses, the Location value refers to the preferred target resource for automatically redirecting the request. 2924 2923 </p> 2924 <p id="rfc.section.7.1.2.p.5">When Location is provided in a <a href="#status.3xx" class="smpl">3xx (Redirection)</a> response and the URI reference that the user agent used to generate the request target contains a fragment identifier, the 2925 user agent <em class="bcp14">SHOULD</em> process the redirection as if the Location field value inherits the original fragment. In other words, if the Location does 2926 not have a fragment component, the user agent <em class="bcp14">SHOULD</em> interpret the Location reference as if it had the original reference's fragment. 2927 </p> 2925 2928 <div id="rfc.figure.u.52"></div> 2926 <p>For example, a GET request for the URI reference "http://www.example.org/~tim" might result in a <a href="#status.303" class="smpl">303 (See Other)</a> response containing the header field:2927 </p> <pre class="text"> Location: / pub/WWW/People.html#tim2928 </pre> <p>which suggests that the user agent redirect to "http://www.example.org/ pub/WWW/People.html#tim"</p>2929 <p>For example, a GET request generated for the URI reference "http://www.example.org/~tim" might result in a <a href="#status.303" class="smpl">303 (See Other)</a> response containing the header field: 2930 </p> <pre class="text"> Location: /People.html#tim 2931 </pre> <p>which suggests that the user agent redirect to "http://www.example.org/People.html#tim"</p> 2929 2932 <div id="rfc.figure.u.53"></div> 2930 <p>Likewise, a GET request for the URI reference "http://www.example.org/index.html#larry" might result in a <a href="#status.301" class="smpl">301 (Moved Permanently)</a> response containing the header field:2933 <p>Likewise, a GET request generated for the URI reference "http://www.example.org/index.html#larry" might result in a <a href="#status.301" class="smpl">301 (Moved Permanently)</a> response containing the header field: 2931 2934 </p> <pre class="text"> Location: http://www.example.net/index.html 2932 2935 </pre> <p>which suggests that the user agent redirect to "http://www.example.net/index.html#larry", preserving the original fragment 2933 2936 identifier. 2934 2937 </p> 2935 <p id="rfc.section.7.1.2.p. 7">There are circumstances in which a fragment identifier in a Location value would not be appropriate. For example, the Location2938 <p id="rfc.section.7.1.2.p.8">There are circumstances in which a fragment identifier in a Location value would not be appropriate. For example, the Location 2936 2939 header field in a <a href="#status.201" class="smpl">201 (Created)</a> response is supposed to provide a URI that is specific to the created resource. 2937 2940 </p> 2938 <div class="note" id="rfc.section.7.1.2.p. 8">2941 <div class="note" id="rfc.section.7.1.2.p.9"> 2939 2942 <p> <b>Note:</b> Some recipients attempt to recover from Location fields that are not valid URI references. This specification does not mandate 2940 2943 or define such processing, but does allow it for the sake of robustness. 2941 2944 </p> 2942 2945 </div> 2943 <div class="note" id="rfc.section.7.1.2.p. 9">2946 <div class="note" id="rfc.section.7.1.2.p.10"> 2944 2947 <p> <b>Note:</b> The <a href="#header.content-location" class="smpl">Content-Location</a> header field (<a href="#header.content-location" id="rfc.xref.header.content-location.3" title="Content-Location">Section 3.1.4.2</a>) differs from Location in that the Content-Location refers to the most specific resource corresponding to the enclosed representation. 2945 2948 It is therefore possible for a response to contain both the Location and Content-Location header fields. -
draft-ietf-httpbis/latest/p2-semantics.xml
r2074 r2075 3719 3719 of a relative reference (<xref target="RFC3986" x:fmt="," x:sec="4.2"/>), 3720 3720 the final value is computed by resolving it against the effective request 3721 URI (<xref target="RFC3986" x:fmt="," x:sec="5"/>). If the original URI, as 3722 navigated to by the user agent, contains a fragment identifier, and the 3723 Location value does not, then the original URI's fragment identifier is 3724 appended to the Location value. 3721 URI (<xref target="RFC3986" x:fmt="," x:sec="5"/>). 3725 3722 </t> 3726 3723 <t> … … 3730 3727 to the preferred target resource for automatically redirecting the request. 3731 3728 </t> 3729 <t> 3730 When Location is provided in a <x:ref>3xx (Redirection)</x:ref> response 3731 and the URI reference that the user agent used to generate the request 3732 target contains a fragment identifier, the user agent &SHOULD; process the 3733 redirection as if the Location field value inherits the original fragment. 3734 In other words, if the Location does not have a fragment component, the 3735 user agent &SHOULD; interpret the Location reference as if it had the 3736 original reference's fragment. 3737 </t> 3732 3738 <figure> 3733 <preamble>For example, a GET request for the URI reference3739 <preamble>For example, a GET request generated for the URI reference 3734 3740 "http://www.example.org/~tim" might result in a 3735 3741 <x:ref>303 (See Other)</x:ref> response containing the header field:</preamble><!--DO NOT DARE changing the vertical spacing below, it's necessary this way for xml2rfc--> 3736 3742 <artwork type="example"> 3737 Location: / pub/WWW/People.html#tim3743 Location: /People.html#tim 3738 3744 </artwork> 3739 3745 <postamble>which suggests that the user agent redirect to 3740 "http://www.example.org/ pub/WWW/People.html#tim"</postamble>3746 "http://www.example.org/People.html#tim"</postamble> 3741 3747 </figure> 3742 3748 <figure> 3743 <preamble>Likewise, a GET request for the URI reference3749 <preamble>Likewise, a GET request generated for the URI reference 3744 3750 "http://www.example.org/index.html#larry" might result in a 3745 3751 <x:ref>301 (Moved Permanently)</x:ref> response containing the header
Note: See TracChangeset
for help on using the changeset viewer.