whatwg / whatwg/fetch

Please add support for an indicator as to whether the page was resolved via a temporary redirect or a permanent one

Open
#892 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

addition/proposal needs implementer interest topic: redirects
Dominant language
HTML
Stars
2.3k
Forks
403
Avg merge
21h 16m
Merged PRs (30d)
4

Description

Use case:
I have a browser app that stores URLs (bookmarks or whatever). From time to time URLs get redirected, either permanently or temporarily.

It would be helpful to update the stored URLs as and when they are permanently redirected, as

  • the original URL may go out of service
  • every time I subsequently use the original URL it will result in one or more extra requests to fetch the web page.

I can tell (in general) that the request has been redirected because the responseURL field will not be the same as the URL I used in the open. However, there's currently no way I can determine if that was due to a temporary redirect or a permanent one. And if the redirect is temporary I do not want to update my stored URL because when the redirect goes away, the URL will be wrong.

Therefore a single (read only) field in the request set to which is filled in on a successful request (with true indicating the url was changed due to one or more temporary redirects, and false indicating that no temporary redirects were found while performing the request) would be extremely helpful.

I think it might also improve users experience if those browsers that displayed the target URL in the address bar took notice of this, as taking a bookmark on a URL generated as the result of a temporary redirect would potentially have unhelpful results.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Fetch Standard's request and redirect processing, including the responseURL behavior described in this issue. Determine how a read-only redirect indicator would represent temporary redirects and what observable behavior the standard should require; the work is done when that behavior is specified consistently.

Written by the indexing model from the issue text.

Assessment

Domain
api, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.