Skip to content

Strange "if" in the RedirectResponse #27574

@ncou

Description

@ncou

Hi,

There is a strange "if" in the RedirectResponse class.
https://github.com/symfony/http-foundation/blob/master/RedirectResponse.php#L45

if (301 == $status && !array_key_exists('cache-control', $headers)) { $this->headers->remove('cache-control'); }

The "not" array_key_exists" seems wrong, because why try to remove the header if the header is not present...

Am i missing something ?

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