Problem/Motivation

Since version 3.1.2 we're getting false positives as already described (and attempted to be fixed) in #3559063: X-Frame-Options false negative, but it's now created the issue instead of solving it.

The reason seems to be that curl responds with lower case header keys, while $this->httpClient->request('GET', $host)->getHeaders() responds with upper case header keys, at least in our instances. I don't know where the difference comes from, but the solution should be dealing with any scenario.

Proposed resolution

Do not just convert the tested header keys to lower case but also the keys in the tested array.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Issue summary: View changes
Status: Active » Needs review
yazzbe’s picture

Thanks!
Patched manually . Fixed the problem.

D10.5.6 | PHP 8.3.29

smustgrave’s picture

Status: Needs review » Needs work

should include a test.

smustgrave’s picture

Status: Needs work » Fixed

Added test coverage for the different scenarios.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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