Forum Discussion

AhmadJ's avatar
AhmadJ
Icon for Altocumulus rankAltocumulus
Jun 03, 2023

exclude HTTP::header value Content-Type] equals "text/xml; charset=utf-8" from SSL redirect

Hi we are trying to exclude from force https irule the below content typeHTTP::header value Content-Type] equals "text/xml; charset=utf-8"  also we are using stream profile because we applied irul...
  • Paulius's avatar
    Paulius
    Jun 04, 2023

    AhmadJ I believe the following iRule should fix what you are referring to. I recommend testing this before putting into production or performing the change in off hours in order to minimize possible downtime if by chance the change is incorrect.

    when HTTP_REQUEST priority 500 {
    
        STREAM::disable
    
    }
    
    when HTTP_RESPONSE priority 500 {
    
        if { ([HTTP::header Content-Type] contains "text/html") && !([HTTP::header Content-Type] == "text/xml; charset=utf-8") } {
            STREAM::expression {@http://@https://@}
            STREAM::enable
        } elseif { ([HTTP::header Content-Type] contains "png") || ([HTTP::header Content-Type] contains "jpeg") || ([HTTP::header Content-Type] contains "application/x-font-woff") || ([HTTP::header Content-Type] contains "pdf") || ([HTTP::header Content-Type] contains "svg") || ([HTTP::header Content-Type] contains "image/svg+xml")} {
            STREAM::disable
        }
    
    }