Forum Discussion

idealo_security's avatar
idealo_security
Icon for Altostratus rankAltostratus
Mar 15, 2017

iRule to block paths is not working properly after decoding HTTP::uri

Hi folks, I was trying to generate an iRule which should take the URL, decode it, normalize the path portion and save it for later use in the following iRules. But unfortunately, I wasn't able to pro...
  • idealo_security's avatar
    Mar 17, 2017

    Solution is found: The error was in not writing the basename back to the

    HTTP:path
    variable:

    when HTTP_REQUEST priority 400 {
     this part is taken from F5s DevCentral
       set tmpUri [HTTP::uri]
       set uri [URI::decode $tmpUri]
    
       while { $uri ne $tmpUri } {
         set tmpUri $uri
         set uri [URI::decode $tmpUri]
       }
        set tmpPath "[URI::path $uri][URI::basename $uri]"
        HTTP::path $tmpPath 
    }