Re: #295: Applying original fragment to "plain" redirected URI (also #43)

Julian Reschke <julian.reschke@gmx.de> Thu, 05 January 2012 20:33 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 42D0921F8870 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 5 Jan 2012 12:33:13 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.643
X-Spam-Level:
X-Spam-Status: No, score=-6.643 tagged_above=-999 required=5 tests=[AWL=2.156, BAYES_00=-2.599, J_CHICKENPOX_17=0.6, J_CHICKENPOX_18=0.6, J_CHICKENPOX_48=0.6, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DbUzhI5CVyWQ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 5 Jan 2012 12:33:12 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id A75AE21F85D0 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Thu, 5 Jan 2012 12:33:12 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.69) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Ritz2-0006rs-48 for ietf-http-wg-dist@listhub.w3.org; Thu, 05 Jan 2012 20:32:20 +0000
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.69) (envelope-from <julian.reschke@gmx.de>) id 1Rityt-0006pv-SO for ietf-http-wg@listhub.w3.org; Thu, 05 Jan 2012 20:32:11 +0000
Received: from mailout-de.gmx.net ([213.165.64.22]) by maggie.w3.org with smtp (Exim 4.72) (envelope-from <julian.reschke@gmx.de>) id 1Rityr-0008My-Ou for ietf-http-wg@w3.org; Thu, 05 Jan 2012 20:32:11 +0000
Received: (qmail invoked by alias); 05 Jan 2012 20:31:41 -0000
Received: from p5DCC35D2.dip.t-dialin.net (EHLO [192.168.178.36]) [93.204.53.210] by mail.gmx.net (mp034) with SMTP; 05 Jan 2012 21:31:41 +0100
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX18gHUhwMFYgsat1yVijav951lLDOu4nT2zEV7DCB4 7IKkk5oOPzzQJR
Message-ID: <4F0608AB.20808@gmx.de>
Date: Thu, 05 Jan 2012 21:31:39 +0100
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Larry Masinter <masinter@adobe.com>
CC: Mark Nottingham <mnot@mnot.net>, httpbis Group <ietf-http-wg@w3.org>
References: <6A53E99A-019D-4F6D-A33D-24524CD34E17@mnot.net> <4EFDFA17.4080804@gmx.de> <4F031419.1050708@gmx.de> <C68CB012D9182D408CED7B884F441D4D06121B5AE5@nambxv01a.corp.adobe.com>
In-Reply-To: <C68CB012D9182D408CED7B884F441D4D06121B5AE5@nambxv01a.corp.adobe.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Received-SPF: pass client-ip=213.165.64.22; envelope-from=julian.reschke@gmx.de; helo=mailout-de.gmx.net
X-W3C-Hub-Spam-Status: No, score=-1.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1Rityr-0008My-Ou 3ae33dd601bc0a60e9883687eab789b7
X-Original-To: ietf-http-wg@w3.org
Subject: Re: #295: Applying original fragment to "plain" redirected URI (also #43)
Archived-At: <http://www.w3.org/mid/4F0608AB.20808@gmx.de>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/11983
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>
Resent-Message-Id: <E1Ritz2-0006rs-48@frink.w3.org>
Resent-Date: Thu, 05 Jan 2012 20:32:20 +0000

On 2012-01-04 05:57, Larry Masinter wrote:
> ...
>
> "Almost", because it doesn't use Base.fragment when R.frament is undefined.
>
> a) Should we try describe the algorithm based on RFC 3986 ("do relative resolution as defined by ..., then, if the result doesn't have a fragment, add the one from the Base URI")?
> b) Is this potentially an erratum for RFC 3986?
>
> a) sounds good.
> b) I'd call it an "update" rather than an erratum.

OK, here's an attempt to describe this:

Appendix A.  Base Fragment Aware Relative Resolution

    Section 5.2 of [RFC3986] defines the Relative Resolution of a URI
    reference against a Base URI.  That algorithm however does not take a
    fragment identifier on the Base URI into account.

    However in some cases, as when following a redirect from a URI "Base"
    based on a Location header field containing the URI reference "R", it
    can be necessary to preserve a fragment identifier present on "Base".
    The algorithm described below does this:

    Given a URI reference "R" and a base URI "Base", to transform R into
    its target URI "T":

    (1) Pre-parse the Base URI as defined in Section 5.2.1 of [RFC3986].

    (2) Transform references as defined in Section 5.2.2 of [RFC3986].
    If the T.fragment is undefined and Base.fragment is defined, then set
    T.fragment to Base.fragment:

      if defined(Base.fragment) and not(defined(T.fragment)) then
        T.fragment = Base.fragment;
      endif;

    (3) Merge paths as defined in Section 5.2.3 of [RFC3986].

    (4) Remove dot segments as defined in Section 5.2.4 of [RFC3986].

    (5) Finally, recompose the components as defined in Section 5.3 of
    [RFC3986].

A.1.  Examples

    Starting with a Base URI of "http://host/path1#f1":

    +-----------+------------------------+------------------------------+
    | R         | T (after RFC 3986      | T (after Base Fragment Aware |
    |           | Relative Resolution)   | Relative Resolution)         |
    +-----------+------------------------+------------------------------+
    | /path2    | http://host/path2      | http://host/path2#f1         |
    | /path2#f2 | http://host/path2#f2   | http://host/path2#f2         |
    +-----------+------------------------+------------------------------+


(this could be an HTTPbis appendix or a standalone document if it's 
needed elsewhere)

Best regards, Julian