Fork me on GitHub
#pedestal
<
2020-08-31
>
jdkealy16:08:00

I’m having trouble removing X-FRAME-OPTIONS headers. Right now, the setting is set to DENY. If I update the headers in an interceptor to “SAMEORIGIN”, it gets overwritten, however I want to remove the header altogether.

isak16:08:18

There is probably a built in / default interceptor that has a :leave clause that executes after yours. Try adding an interceptor with a :leave as the very first interceptor.

isak16:08:19

e.g.,:

(update ::http/interceptors
              (fn [xs s] (into [s] xs))
              (interceptor/interceptor
                {:name :fix-xframe
                 :leave (fn [ctx]
                          ;...
                          )}))

jdkealy16:08:29

Right I’ve done that. If I leave the X-FRAME-OPTIONS header undefined it just gets set to deny

jdkealy16:08:47

If I set it to SAMEORIGIN, it stays as SAMEORIGIN

isak16:08:35

Hmm, maybe it is coming from Jetty (or your webserver)