Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ResponseHeaderBag::computeCacheValue() doesn't handle cloning well #16171

Copy link
Copy link
Closed
@neclimdul

Description

@neclimdul
Issue body actions

Consider the following test:

<?php
class HeaderTest extends UnitTestCase {
  public function testHeaderBag() {
    $headers = ['test'];
    $bag1 = new ResponseHeaderBag($headers);
    $bag2 = new ResponseHeaderBag($bag1->allPreserveCase());
    $this->assertEquals($bag1->allPreserveCase(), $bag2->allPreserveCase());
  } 
}
?>

It was my assumption that this would pass but it ends up not.

Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => Array (...)
     'Cache-Control' => Array (
-        0 => 'no-cache'
+        0 => 'no-cache, private'
     )
 )

I'm not sure the solution but these aren't technically the same thing so its seems buggy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.