Page MenuHomePhabricator

Attach Content-Location header to RESTBase responses
Closed, ResolvedPublic

Description

When making requests via XHR or fetch in browsers, there is no way of knowing whether the request involved following a redirect, and what the resulting resource URI is. For this reason clients wouldn't be able to display the proper article title, or something like 'Redirected from' message. To fix this, we are considering to add the Content-Location header to indicate the real location of the resource.

Although the header definition allows setting relative URIs, in our case the header should contain absolute URI, because we sometimes do non-same-level redirects, and it's impossible to figure out the correct relative URI in this case.

The header should be set on all non-redirect responses to GET requests including errors like 404 or 400 since the browser could be redirected to a non-existing page. Header should not be set on the redirect responses because they already contain the Location header.

To build the absolute resource URI RESTBase would need a notion of it's public URI that could be configured using some template parameter.

Event Timeline

Pchelolo created this task.Oct 28 2016, 7:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 28 2016, 7:45 PM
Pchelolo renamed this task from Attach Content-Location header to RESTBase responces to Attach Content-Location header to RESTBase responses.Oct 28 2016, 7:48 PM
Pchelolo updated the task description. (Show Details)

The PR has been merged - moving to done until deployed

Pchelolo closed this task as Resolved.Nov 4 2016, 8:41 PM

Deployed and tested. Resolving.