X-Frame-Options is always SAMEORIGIN in response header

Created on 5 October 2021, about 3 years ago
Updated 8 March 2023, almost 2 years ago

Problem/Motivation

Wanted to embed some content from a D8 site in an iFrame in another site.

Steps to reproduce

Install X-Frame-Options Configuration , set it's config value to ALLOW ALL
(Image Allow-all.png)

Clear caches and reload the front page of the site and inspect the HTTP headers
It still says "X-Frame-Options: SAMEORIGIN"
(Image response-headers.png)

I put debugging points in this modules code, and see it hit
$response->headers->remove('X-Frame-Options');
But the X-Frame-Options headers are still there with a value of SAMEORIGIN
(Image code.png)

Am I missing something here/doing something wrong?

I also tried seckit https://www.drupal.org/project/seckit β†’
and http_response_headers https://www.drupal.org/project/http_response_headers β†’
Neither of those worked either, despite claiming they would be able to change X-Frame-Options.
Is Drupal core wielding it's big hammer, and insisting that X-Frame-Options SAMEORIGIN is always there?

I solved my "I need to put bits of my site into a iFrame on another site" problem by implementing an custom EventListener after reading this https://www.drupal.org/project/drupal/issues/2652616#comment-11433225 πŸ› make x-frame-options configurable Postponed

This may not be a problem with x_frame_options at all, but I'm leaving this stream of consciousness, in case anyone else needs to spend a day going down this rabbit hole....

πŸ› Bug report
Status

Fixed

Version

1.2

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States mr_scumbag Chattanooga TN USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024