Forum Discussion

vaibhav_salunk2's avatar
vaibhav_salunk2
Icon for Nimbostratus rankNimbostratus
Apr 08, 2020

x-content-type-options

Hi,   I want to insert X-Content-Type-Options value as nosniff in http header using i-rule and below is my syntax.   when HTTP_RESPONSE { if { [HTTP::header exists "X-Content-Type-Options"]...
  • Lidev's avatar
    Apr 08, 2020

    Hello,

    Here is the correct syntax

    when HTTP_RESPONSE_RELEASE { 
    if {!([HTTP::header exists "X-Content-Type-Options"])} {
            HTTP::header insert "X-Content-Type-Options" "nosniff"
        }
    }

    REF - https://support.f5.com/csp/article/K04436209