Forum Discussion

martin_58353's avatar
Sep 09, 2017

iRule STREAM::expression is not working

Hello, I have an issue with some html code injection. Below is LTM config and iRule. LTM config: ltm virtual /IB/vs_george-uat2_8090 { description "george-uat2" destination /...
  • martin_58353's avatar
    Sep 11, 2017

    I have solution!

     

    REQUEST event has no Content-Type in HTTP header, therefore is condition always false. Here is a correct code:

     

        when HTTP_REQUEST {
          set path [HTTP::path]
    
          switch $path {
            "/" {
              removed if { [HTTP::header value Content-Type] contains "text/html" } {
                HTTP::header remove "Accept-Encoding"
              removed }
            }
          }
        }