8000 ResponseHeaderBag::computeCacheValue() doesn't handle cloning well · Issue #16171 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
ResponseHeaderBag::computeCacheValue() doesn't handle cloning well #16171
Closed
@neclimdul

Description

@neclimdul

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

      0