Problem/Motivation

When a page redirects, no cacheability metadata is attached to the response. As a result it is currently not safe to cache redirect responses.

At #2527126-126: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them, @Berdir pointed out that the redirect module in Drupal 8 in fact does force its redirect responses to be cached, by exploiting an implementation detail in Page Cache (that has been present for a long time in Drupal 8, and is also present in RC1): the Page Cache has been parsing the X-Drupal-Cache-Tags header to make its redirect responses be cached in the Page Cache.
That issue is changing that behavior to not rely on that internal implementation detail, and is making Page Cache only support tag-based invalidation if the response implements CacheableResponseInterface.
Berdir raised a concern in that issue that this is technically breaking BC (#2527126-128: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them. So Wim Leers brought back BC (#2527126-130: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them) despite his concerns that this would be far more difficult to understand.
effulgentsia then raised a concern (#2527126-134: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them) about that BC layer: providing that BC is effectively turning an implementation detail into an API. catch discussed this concern of effulgentsia with berdir in IRC (#2527126-136: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them) and confirms that this was not actually an API. In fact, he goes further: he says it's actually a bug that redirect's responses can be cached by exploiting that implementation detail. Hence it's a bug fix to stop caching any redirects (i.e. what #2527126: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them does), and an API addition to start caching some of them (i.e. THIS issue).
Finally, given that careful weighing of pros & cons, alexpott & catch concluded (#2527126-138: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them) that THIS issue should go in first, so that redirect (and other modules) in D8 contrib can send cacheable redirect responses using the official API, and THEN we should do #2527126: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them.

(If anything is unclear, please read #2527126-136: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them in full, it contains a lengthier explanation with more nuance.)

Proposed resolution

  1. IntroduceCacheableRedirectResponse.
  2. Using that in RedirectLeadingSlashesSubscriber.
  3. Introduce CacheableSecuredRedirectResponse which extend SecuredRedirectResponse, making it cacheable. We can't update SecuredRedirectResponse directly because it lives in Component and CacheableResponseInterface lives in Core.
  4. Add test coverage for that in TrustedRedirectResponseTest.

Only 7 files touched, only 8 KB patch, no disruption, no BC break, and very simple to review :)

Remaining tasks

None.

User interface changes

None.

API changes

Beta phase evaluation

Issue priority Major because hugely affects front-end performance.
Prioritized changes The main goal of this issue is (front-end) performance: This would be very valuable to have in 8.0.0, especially for modules that do redirects. Cacheable redirects make things much faster for the end user (because it also means the redirect can be cached in the browser's cache). It's also a contributed project blocker.
Disruption Zero disruption.

Data model changes

None.

CommentFileSizeAuthor
#62 interdiff.txt4.86 KBWim Leers
#62 cacheableredirectresponse-2573923-62.patch8.05 KBWim Leers
#59 interdiff.txt15.89 KBWim Leers
#59 cacheableredirectresponse-2573923-58.patch5.8 KBWim Leers
#49 rebase-interdiff.txt1.55 KBWim Leers
#49 introduce_a-2573923-49.patch13.26 KBWim Leers
#46 introduce_a-2573923-46.patch12.15 KBvisabhishek
#28 interdiff.txt982 bytesznerol
#28 introduce_a-2573923-28.patch13.11 KBznerol
#24 introduce_a-2573923-24.patch12.15 KBznerol
#24 interdiff.txt530 bytesznerol
#23 interdiff.txt6.08 KBznerol
#23 introduce_a-2573923-22.patch12.67 KBznerol
#19 interdiff.txt4.51 KBznerol
#19 introduce_a-2573923-19.patch9.46 KBznerol
#17 interdiff.txt1.59 KBznerol
#17 introduce_a-2573923-17.patch6.94 KBznerol
#11 introduce_a-2573923-11.patch5.34 KBznerol
#11 interdiff.txt1008 bytesznerol
#10 interdiff.txt2.04 KBznerol
#10 introduce_a-2573923-10.patch5.49 KBznerol
#4 interdiff.txt1012 bytesznerol
#4 introduce_a-2573923-4.patch3.45 KBznerol
#2 introduce_a-2573923-2.patch2.46 KBznerol
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

znerol created an issue. See original summary.

znerol’s picture

Status: Active » Needs review
FileSize
2.46 KB
znerol’s picture

+++ b/core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php
@@ -57,8 +57,9 @@ protected function url($route_name, $route_parameters = array(), $options = arra
+    $url = $this->url($route_name, $route_parameters, $options, TRUE);
+    $response = new CacheableRedirectResponse($url->getGeneratedUrl(), $status);
+    return $response->addCacheableDependency($url);

This might be wrong. We might want to collect cacheability metadata for the current request, not (only) for the route we are about to redirect to.

znerol’s picture

The remaining instances of RedirectResponse are either used in an administrative context or in tests:

$ git grep -l 'new RedirectResponse' | grep -v vendor 
core/includes/batch.inc
core/includes/form.inc
core/includes/install.inc
core/lib/Drupal/Core/DrupalKernel.php
core/lib/Drupal/Core/Form/FormSubmitter.php
core/modules/action/src/Plugin/Action/GotoAction.php
core/modules/comment/src/Controller/CommentController.php
core/modules/config/tests/config_test/src/ConfigTestController.php
core/modules/locale/locale.pages.inc
core/modules/node/src/Form/DeleteMultiple.php
core/modules/simpletest/src/Form/SimpletestResultsForm.php
core/modules/system/src/Form/CronForm.php
core/modules/system/system.module
core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php
core/modules/update/update.manager.inc
core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php
core/tests/Drupal/Tests/Core/Form/FormStateTest.php
core/tests/Drupal/Tests/Core/Form/FormSubmitterTest.php

The last submitted patch, 2: introduce_a-2573923-2.patch, failed testing.

The last submitted patch, 2: introduce_a-2573923-2.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: introduce_a-2573923-4.patch, failed testing.

The last submitted patch, 4: introduce_a-2573923-4.patch, failed testing.

znerol’s picture

Test failures are reproducible with the following test:

    $this->drupalLogin($some_user);
    $this->drupalLogout();
    $this->drupalLogin($some_other_user);
    $this->drupalLogout();

The second time drupalLogout() is called, the dynamic cache produces a HIT and thus the logout is not performed.

znerol’s picture

Status: Needs work » Needs review
FileSize
5.49 KB
2.04 KB
znerol’s picture

@WimLeers suggests to just use the no_cache route option.

The last submitted patch, 10: introduce_a-2573923-10.patch, failed testing.

The last submitted patch, 10: introduce_a-2573923-10.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 11: introduce_a-2573923-11.patch, failed testing.

The last submitted patch, 11: introduce_a-2573923-11.patch, failed testing.

Wim Leers’s picture

Patch looks great :)

znerol’s picture

Status: Needs work » Needs review
FileSize
6.94 KB
1.59 KB

Status: Needs review » Needs work

The last submitted patch, 17: introduce_a-2573923-17.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
FileSize
9.46 KB
4.51 KB

Using no_cache routing option in order to exclude LocaleController::checkTranslation(), also introduce a CacheableRedirectResponseInterface for proper type hinting.

znerol’s picture

Really not sure what should be done about TrustedRedirectResponse and LocalRedirectResponse.

Status: Needs review » Needs work

The last submitted patch, 19: introduce_a-2573923-19.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review

Completely missed that Symfony does not provide a RedirectResponseInterface :(

Adding CacheableResponseTrait to TrustedRedirectResponse and LocalRedirectResponse. It looks like contrib will benefit from that.

znerol’s picture

znerol’s picture

The last submitted patch, 23: introduce_a-2573923-22.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 24: introduce_a-2573923-24.patch, failed testing.

The last submitted patch, 17: introduce_a-2573923-17.patch, failed testing.

znerol’s picture

Status: Needs work » Needs review
FileSize
13.11 KB
982 bytes

The url() call in the locale_test.module is spoiling the render context. Let's use something more appropriate (i.e. file_create_url).

The last submitted patch, 19: introduce_a-2573923-19.patch, failed testing.

The last submitted patch, 23: introduce_a-2573923-22.patch, failed testing.

The last submitted patch, 24: introduce_a-2573923-24.patch, failed testing.

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Looks great to me; boldly RTBCing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 28: introduce_a-2573923-28.patch, failed testing.

borisson_’s picture

Fabianx’s picture

Status: Needs work » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 28: introduce_a-2573923-28.patch, failed testing.

Wim Leers’s picture

Status: Needs work » Reviewed & tested by the community
Wim Leers’s picture

Issue tags: +rc target

This would be very valuable to have in 8.0.0, especially for modules that do redirects. Cacheable redirects make things much faster for the end user (because it also means the redirect can be cached in the browser's cache).

xjm’s picture

Issue tags: -rc target

See https://groups.drupal.org/node/484788 for more information on the rc target tag. Could we put a bit on the impact vs. disruption in the summary to help decide when this patch can go in safely? Thanks! Maybe @catch could confirm if this is non-disruptive and important enough to be committed during RC.

Wim Leers’s picture

Issue summary: View changes
+++ b/core/lib/Drupal/Core/Routing/LocalRedirectResponse.php
@@ -8,14 +8,33 @@
-class LocalRedirectResponse extends SecuredRedirectResponse {
+class LocalRedirectResponse extends SecuredRedirectResponse implements CacheableResponseInterface {

+++ b/core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php
@@ -8,14 +8,18 @@
-class TrustedRedirectResponse extends SecuredRedirectResponse {
+class TrustedRedirectResponse extends SecuredRedirectResponse implements CacheableResponseInterface {

I first thought these mean this can't go in after RC. But I think that's not true. Even if you've subclassed these objects, you won't have to change anything. So AFAICT there's no API change.

So I was mistaken in tagging this rc target earlier in any case. Sorry about that.

Added the impact vs disruption to the IS.

Fabianx’s picture

RTBC + 1 - it would be good to get this in before RC, but it potentially has big enough merit and less enough disruption to justify to go in later.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 28: introduce_a-2573923-28.patch, failed testing.

Fabianx’s picture

Issue tags: +Needs reroll
visabhishek’s picture

visabhishek’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 46: introduce_a-2573923-46.patch, failed testing.

Wim Leers’s picture

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC

The last submitted patch, 46: introduce_a-2573923-46.patch, failed testing.

Fabianx’s picture

Issue tags: +rc target triage

Adding triage tag; it was also RTBC before RC deadline.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -rc target triage +rc target, +Needs issue summary update

Given the recent discussions on #2527126: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them and the fact that that patch removes support for cacheable redirects (through a side effect) I think it is important that we introduce proper cacheable redirects during RC.

It'd been great if the IS can be updated with some of the discussions about previous support of redirect caching in Drupal 8 as a justification for this been done during RC.

catch’s picture

Status: Needs work » Needs review
+++ b/core/modules/user/user.routing.yml
@@ -12,6 +12,8 @@ user.logout:
+    no_cache: TRUE

Why is this necessary? Shouldn't caching for redirects be opt-in?

Or should 302s default to not cacheable and 301s default to cacheable?

I deliberately didn't re-read this issue, just trying to figure out the dependencies between this and #2527126: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them.

catch’s picture

Priority: Normal » Major
Wim Leers’s picture

Lunch now, but I'll try to answer all questions here unless @znerol beats me to it.

Wim Leers’s picture

Issue summary: View changes

It'd been great if the IS can be updated with some of the discussions about previous support of redirect caching in Drupal 8 as a justification for this been done during RC.

Done.

Fabianx’s picture

IMHO it is more than enough to say:

#2476407: Use CacheableResponseInterface to determine which responses should be cached made only CacheableResponseInterface responses cacheable by default.

We want to support that for redirects as well as there is a ContributedProjectBlocker for redirect module.

And cacheable redirects are a very common need.

Wim Leers’s picture

Why is this necessary? Shouldn't caching for redirects be opt-in?

I agree. It looks like @znerol wanted to make as many redirects as possible cacheable. But of course, often times redirects happen after something happened. Which means the overall response is not actually cacheable.

Reviewing this patch again:

  1. +++ b/core/lib/Drupal/Core/EventSubscriber/RedirectLeadingSlashesSubscriber.php
    @@ -39,7 +39,7 @@ public function redirect(GetResponseEvent $event) {
    -      $event->setResponse(new RedirectResponse($request->getUriForPath($path) . $qs));
    +      $event->setResponse(new CacheableRedirectResponse($request->getUriForPath($path) . $qs));
    

    This is indeed a perfectly cacheable redirect response, and it doesn't require any additional cacheability metadata, because it doesn't depend on any external information. It's a hard-coded redirect essentially.

  2. +++ b/core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php
    @@ -28,6 +32,21 @@ class TrustedRedirectResponse extends SecuredRedirectResponse {
    +  protected function fromResponse(RedirectResponse $response) {
    +    parent::fromResponse($response);
    +
    +    $metadata = $this->getCacheableMetadata();
    +    if ($response instanceof CacheableResponseInterface) {
    +      $metadata->merge($response->getCacheableMetadata());
    +    }
    +    else {
    +      $metadata->setCacheMaxAge(0);
    +    }
    +  }
    

    This is very much worth having, but test coverage is missing.

  3. +++ b/core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php
    @@ -35,13 +35,17 @@
    +   * Note that responses generated by this method are cacheable by default.
    +   * Calling code is responsible for adding appropriate cacheability metadata
    +   * and cache dependencies respectively.
    

    This is the API change that is not acceptable anymore.

  4. +++ b/core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php
    @@ -52,13 +56,14 @@ protected function url($route_name, $route_parameters = array(), $options = arra
    -    $url = $this->url($route_name, $route_parameters, $options);
    -    return new RedirectResponse($url, $status);
    +    $url = $this->url($route_name, $route_parameters, $options, TRUE);
    +    $response = new CacheableRedirectResponse($url->getGeneratedUrl(), $status);
    +    return $response->addCacheableDependency($url);
    

    i.e. these changes need to be reverted.

  5. +++ b/core/modules/locale/locale.routing.yml
    @@ -10,6 +10,8 @@ locale.check_translation:
    +  options:
    +    no_cache: TRUE
    

    Then all of these can go away.

  6. +++ b/core/modules/node/src/Controller/NodeController.php
    @@ -93,7 +94,9 @@ public function addPage() {
    -      return $this->redirect('node.add', array('node_type' => $type->id()));
    +      $response = $this->redirect('node.add', ['node_type' => $type->id()]);
    +      $response->getCacheableMetadata()->setCacheTags($list_cache_tags);
    +      return $response;
    

    This one actually is cacheable, but… on 99% of sites, node.add is an admin route, so this won't be cached. Also, the redirect only happens if there's only one node type, which is something even less likely.

    So we'd be introducing a change here during RC with very, very limited benefit. So let's revert this one too.

  7. +++ b/core/modules/user/user.routing.yml
    --- a/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTraitTest.php
    +++ b/core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTraitTest.php
    

    Given we no longer modify UrlGeneratorTrait::redirect(), all these changes become obsolete too.

  8. --- a/core/modules/locale/tests/modules/locale_test/locale_test.module
    +++ b/core/modules/locale/tests/modules/locale_test/locale_test.module
    

    The changes in this file should also no longer be necessary.

  9. +++ b/core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php
    @@ -35,13 +35,17 @@
    -  protected function url($route_name, $route_parameters = array(), $options = array()) {
    -    return $this->getUrlGenerator()->generateFromRoute($route_name, $route_parameters, $options);
    +  protected function url($route_name, $route_parameters = array(), $options = array(), $collect_bubbleable_metadata = FALSE) {
    +    return $this->getUrlGenerator()->generateFromRoute($route_name, $route_parameters, $options, $collect_bubbleable_metadata);
    

    This is an appropriate bugfix, but belongs in a separate issue. Especially now that this is the only remaining change in this file.

  10. +++ b/core/lib/Drupal/Core/Routing/LocalRedirectResponse.php
    @@ -8,14 +8,33 @@
    -class LocalRedirectResponse extends SecuredRedirectResponse {
    +class LocalRedirectResponse extends SecuredRedirectResponse implements CacheableResponseInterface {
     
    +  use CacheableResponseTrait;
    

    Rather than doing this here and for TrustedRedirectResponse, it makes more sense to just do it ONCE inSecuredRedirectResponse.


With that drastic reduction in scope, the changes in this patch are now limited to:

  1. Introducing CacheableRedirectResponse.
  2. Using that in RedirectLeadingSlashesSubscriber.
  3. Update SecuredRedirectResponse to extend CacheableRedirectResponse.
  4. Add test coverage for that in TrustedRedirectResponseTest.

Only 4 files touched, only 6 KB patch, no disruption, no BC break, and much, much simpler to review :)

Status: Needs review » Needs work

The last submitted patch, 59: cacheableredirectresponse-2573923-58.patch, failed testing.

Wim Leers’s picture

So now I know why #60.10 wasn't implemented in the original patch:

Checking for illegal reference to 'Drupal\Core' namespace in /Users/wim.leers/Work/drupal-tres/core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php
Failed asserting that an array is empty.

I guess I'll have to move that back to the individual subclasses.

Wim Leers’s picture

Status: Needs work » Needs review
FileSize
8.05 KB
4.86 KB

Added abstract class CacheableSecuredRedirectResponse extends SecuredRedirectResponse implements CacheableResponseInterface {} to \Drupal\Core\Routing, which LocalRedirectResponse and TrustedRedirectResponse now both extend. Still prevents that duplication, so still better than duplicating the logic in both of them.

Wim Leers’s picture

Issue summary: View changes

IS updated: updated proposed resolution and beta eval.

Wim Leers’s picture

When/if this lands, we should also update https://www.drupal.org/developing/api/8/response.

znerol’s picture

I realize now that there is not too much benefit in making every redirect response cacheable - especially those generated after form submissions. The motivation to open this issue was #2476407: Use CacheableResponseInterface to determine which responses should be cached which killed cacheability for redirect responses completely. Now that this patch went away from making controller and form redirects cacheable by default, we should look for those cases where caching those responses is desirable (i.e. static redirect responses in non-admin pages).

Candidates can be found like this:

find . -type f -and -not -ipath '*test*' -and -not -ipath '*form*' | xargs git grep -- -l '->redirect('

The following occurrences likely should be made cacheable:

  1. AccessDeniedSubscriber::onException() (redirect anonymous users from /user to /user/login)
  2. CommentController::redirectNode()
  3. SearchController::redirectSearchPage()
Wim Leers’s picture

#65: woah, nice command!

I agree that #65 is very valuable to do. But those responses weren't cached in Page Cache before either, right? This issue is both a contrib blocker and blocking #2527126: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them. I think it's therefore important to keep this patch as minimal as possible. I think it'd be easier to make the changes you're suggesting in a follow-up issue, since they're purely nice-to-haves.

Of course, if committers would like to see that happen here, then I'd be happy to oblige.

znerol’s picture

But those responses weren't cached in Page Cache before either

They were, and that is exactly why I opened this issue. The redirect responses are cached despite the fact that they are lacking any cacheability metadata, like described in the original issue summary.

This is with d5c827e:

wget -SO /dev/null http://127.0.0.1:3000/user
--2015-10-16 11:53:04--  http://127.0.0.1:3000/user
Connecting to 127.0.0.1:3000... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 302 Found
  Cache-Control: max-age=600, public
  Date: Fri, 16 Oct 2015 09:52:45 GMT
  Location: http://127.0.0.1:3000/user/login
  X-UA-Compatible: IE=edge
  Content-language: en
  X-Content-Type-Options: nosniff
  X-Frame-Options: SAMEORIGIN
  Expires: Sun, 19 Nov 1978 05:00:00 GMT
  Last-Modified: Fri, 16 Oct 2015 09:52:45 GMT
  ETag: "1444989165"
  Vary: Cookie
  X-Generator: Drupal 8 (https://www.drupal.org)
  X-Drupal-Cache: HIT
  Content-Type: text/html; charset=UTF-8
  Connection: close
  Transfer-Encoding: chunked
  Server: lighttpd/1.4.35

And this is with HEAD:

wget -SO /dev/null http://127.0.0.1:3000/user
--2015-10-16 11:59:43--  http://127.0.0.1:3000/user
Connecting to 127.0.0.1:3000... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 302 Found
  Cache-Control: must-revalidate, no-cache, post-check=0, pre-check=0, private
  Date: Fri, 16 Oct 2015 09:59:38 GMT
  Location: http://127.0.0.1:3000/user/login
  X-UA-Compatible: IE=edge
  Content-language: en
  X-Content-Type-Options: nosniff
  X-Frame-Options: SAMEORIGIN
  Expires: Sun, 19 Nov 1978 05:00:00 GMT
  X-Generator: Drupal 8 (https://www.drupal.org)
  X-Drupal-Cache: HIT
  Content-Type: text/html; charset=UTF-8
  Connection: close
  Transfer-Encoding: chunked
  Server: lighttpd/1.4.35

So, the response will not be stored anymore by external caches/browsers. Also as soon as #2527126: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them lands, the response will not be cached anymore in the internal cache. It seems to me that we are solving the lack of metadata problem by introducing a performance regression.

Wim Leers’s picture

This is with d5c827e:

That is the commit before #2476407: Use CacheableResponseInterface to determine which responses should be cached landed. So your motivation for this issue is fixing the regression for redirects in core, caused by #2476407.

But, the "contributed project blocker" bit and the "blocking #2527126" bit are the reasons this is an rc target.

The regression caused by #2476407 is merely unfortunate, its impact is very low. And I think it can easily be argued that those redirects being cacheable was mostly accidental, because there was no test coverage for them.

So, in summary: this issue is an rc target because it blocks another rc target. This patch is now a pure API addition. That makes it much easier to commit during RC. I realize that that is maybe different from your original intent with this issue, but would you not be okay with moving the "make those 3 redirects cacheable" to a separate issue? I'm happy to open that issue and file the patch.

znerol’s picture

Re #68 sure.

RTBC +1

Wim Leers’s picture

Fabianx’s picture

Status: Needs review » Reviewed & tested by the community

RTBC

alexpott’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Committed e900ded and pushed to 8.0.x. Thanks!

diff --git a/core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php b/core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php
index 66cbf36..5a7d4bb 100644
--- a/core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php
+++ b/core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php
@@ -39,6 +39,9 @@ public static function createFromRedirectResponse(RedirectResponse $response) {
 
   /**
    * Copies over the values from the given response.
+   *
+   * @param \Symfony\Component\HttpFoundation\RedirectResponse $response
+   *   The redirect reponse object.
    */
   protected function fromResponse(RedirectResponse $response) {
     $this->setProtocolVersion($response->getProtocolVersion());

Missing @param fixed on commit.

  • alexpott committed e900ded on 8.0.x
    Issue #2573923 by znerol, Wim Leers, visabhishek, Fabianx, catch:...
Wim Leers’s picture

Wim Leers’s picture

Berdir’s picture

Note: This already broke redirect.module, because it returns trusted responses and this now replaced the manually set cache tags header. Fixed here: https://github.com/md-systems/redirect/commit/0e8a0e4f305ec086b61bc3aea0...

The good part is that this means that #2527126: Only send X-Drupal-Cache-Tags and -Contexts headers when developer explicitly enables them is even less an API change now, since it no longer breaks redirect.module as it was already broken and fixed. That issue won't affect it anymore ;)

Status: Fixed » Closed (fixed)

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