Problem/Motivation

Redirect responses are currently not supported in Tome, but should be.

Proposed resolution

Create an API for handling redirects, that can be extended to generate an .htaccess file or Netlify _redirects file before falling back to an HTML redirect (with <meta http-equiv="refresh" content="0; url=..." />).

Remaining tasks

Write a patch.

User interface changes

None.

API changes

TBD.

Data model changes

None.

Release notes snippet

TBD.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

samuel.mortenson created an issue. See original summary.

samuel.mortenson’s picture

FileSize
11.15 KB

Here's a start to this, should have time before beta 2 to add tests. Still need to add some kind of event API for reacting to responses.

samuel.mortenson’s picture

FileSize
12.68 KB
6.39 KB

Test coverage added, need to add the API.

samuel.mortenson’s picture

Status: Active » Needs review
FileSize
16.03 KB
4.15 KB

This event should be enough to generate a redirects file.

Status: Needs review » Needs work

The last submitted patch, 4: 3017423-4.patch, failed testing. View results

samuel.mortenson’s picture

Status: Needs work » Needs review
FileSize
15.82 KB
659 bytes

Huh, didn't know this annotation was possible.

samuel.mortenson’s picture

This looks good, but I'm wondering if instead of a new event, we could just flag Tome requests in a way that typical Response subscribers could pick up on - No new API necessary.

samuel.mortenson’s picture

FileSize
14.44 KB
3.1 KB

This feels way better.

samuel.mortenson’s picture

FileSize
13.42 KB
1.02 KB
samuel.mortenson’s picture

FileSize
13.13 KB
972 bytes

  • samuel.mortenson authored f1a4b16 on 8.x-1.x
    Issue #3017423 by samuel.mortenson: Create an API for handling redirects
    
samuel.mortenson’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dpi’s picture

If anyone is trawling through Tome code and is wondering how/where the redirect is added, it can be found in Symfony as a form of a fallback to Location headers in \Symfony\Component\HttpFoundation\RedirectResponse.