Forum Discussion
irule error x-content-type-options
I am trying to create the following irule but keep getting error message.
when HTTP_RESPONSE { if {!([HTTP::header exists "X-Content-Type-Options" ])} { HTTP::header insert "X-Content-Type-Options" "'nosniff'" }
Error message below
x-content-type-options Definition 01070151:3: Rule [/Common/x-content-type-options] error: /Common/x-content-type-options:1: error: [parse error: missing close-brace][{ if {!([HTTP::header exists "X-Content-Type-Options" ])} { HTTP::header insert "X-Content-Type-Options" "'nosniff'" }] /Common/x-content-type-options:2: error: [command is not valid in the current scope][if {!([HTTP::header exists "X-Content-Type-Options" ])} { HTTP::header insert "X-Content-Type-Options" "'nosniff'" }]
- Lee_SutcliffeNacreous
Make sure you include the close bracket at the end:
when HTTP_RESPONSE { if {!([HTTP::header exists "X-Content-Type-Options"])} { HTTP::header insert "X-Content-Type-Options" "nosniff" } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com