Forum Discussion

Sinistrad_29710's avatar
Sinistrad_29710
Icon for Nimbostratus rankNimbostratus
Feb 23, 2017

iRule STREAM

Hi all,

 

I'm testing the iRule below but it seems to be false, because i get an Error 411 :

 

when HTTP_REQUEST { if { [HTTP::host] eq "alfons-pp.domain.com" } { STREAM::disable HTTP::header remove "Accept-Encoding" } }

 

when HTTP_RESPONSE { if { ([HTTP::header value Content-Type] contains "text") and ([HTTP::header values Location] contains "alfons-pp.domain.com") } { STREAM::expression {@@} STREAM::enable } }

 

Could you please help me making this iRule works ?

 

2 Replies

  • Hi,

     

    What happens if you change your stream expression for:

     

    STREAM::expression {@@} to STREAM::expression "@

     

    Cheers,

     

    Kees

     

  • Ajit's avatar
    Ajit
    Icon for Altostratus rankAltostratus

    Hello Sinistrad,

    Try the following iRule and let me know how it goes :

    when HTTP_REQUEST {
      HTTP::header remove "Accept-Encoding"
      STREAM::disable
      set host [HTTP::host]
    }
    
    when HTTP_RESPONSE {
      STREAM::disable
      
      if { [HTTP::header exists Location] } {
        HTTP::header replace Location [string map {"http://" "https://"} [HTTP::header Location]]
      }
      
      if { [HTTP::header Content-Type] contains "text" } {
        set before "http://${host}:80/"
        set after "https://${host}/"
    
        STREAM::expression "@${before}@${after}@"
        STREAM::enable
      }
    }
    

    Regards,

    AS