Forum Discussion

ashley_sauls_67's avatar
ashley_sauls_67
Historic F5 Account
Jun 08, 2016

char "?" in a string ends reading of rule

I have a customer that is trying to write an iRule for a http::path rewrite to a different string then what was passed in. Their process works fine for about 4 different virtual servers and URLs. They are running into a problem where the new http path contains a "?" character. This is causing the LTM to behave in strange ways. It doesn't know how to process the ? and rewrites random characters into the path. If they remove the ? then it writes it correctly.

I can't seem to find any info on the ? character looking through devcentral, is this a legal character to use in a string? is there a way to escape it and allow it? ie workaround?

Irule in question is:

when HTTP_REQUEST {
    switch -glob [HTTP::path] 
        {
        "/invoke/diabloXML/receive66" {
            pool deep_pool
        }

        "/invoke/A2M_direct.entry/processDoc" {
            pool Wading_pool
        }

        "/test" {
                        HTTP::path "/?publication=abcde"   
                        pool A2M_pool 
        }

        default {
            discard
        }
    }

}

1 Reply

  • Look at this link to differentiate between URI, Path, Query & Host values in iRule.

     

    You should probably use HTTP::uri instead of HTTP::path.

     

    HTTP::path is all the characters between the 1st "/" and the character before the "?"