This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23361 - Ability to look up the final URL after redirects
Summary: Ability to look up the final URL after redirects
Status: RESOLVED DUPLICATE of bug 15417
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: XHR (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
Depends on:
Reported: 2013-09-26 02:02 UTC by Gili
Modified: 2013-09-26 12:49 UTC (History)
2 users (show)

See Also:


Description Gili 2013-09-26 02:02:35 UTC
In trying to design a RESTful API, I find myself needing to canonicalize URLs:

Given two URLs, X and Y, I'd like to find out whether they reference the same resource. If the canonical forms of the URLs are identical, then X and Y must reference the same resource.

The theory goes that when a request is issued against url A, it will redirect to B that redirects to C and so on ... until it settles at the canonical form X. In order to look up the canonical form of A, I simply issue an HTTP HEAD or GET, let redirection occur, and look up the final URL.

Because XMLHttpRequest does not provide a mechanism to look up the final URL after redirection, I have no way of finding out a resource's canonical URL.

The only known workaround is to add a resource's canonical URL into the response body or headers, but this hackish (forcing us to embed duplicate data into the resource state purely to please browsers while other clients do not need this).
Comment 1 Anne 2013-09-26 12:49:51 UTC

*** This bug has been marked as a duplicate of bug 15417 ***