Forum Discussion

MR_Freddy's avatar
MR_Freddy
Icon for Nimbostratus rankNimbostratus
Sep 19, 2019

Drop connection for ActiveSync based on URI Query

Hi Guys,

 

If i need to drop the connection for "POST" /MS-Server-ActiveSync based on parameter value for URI query (EX: DeviceNO = xxx)

 

I did the following but without success using fiddler

 

when HTTP_REQUEST {

  if { [string tolower [HTTP::uri]] starts_with "/Microsoft-Server-ActiveSync" } {

    set test [URI::query [string tolower [HTTP::uri]] DeviceNo]

    if { !([class match $test equals DeviceNo-DG]) } {

      log local0. "blocked"

drop

log local0. "blocked2"

    }

  }

}

 

DeviceNO-DG is configured using "String DATA Group" with the needed DEVICENO

 

Any suggestion

 

3 Replies

  • Hi MR.Freddy,

    string tolower: Returns a value equal to string only that all upper case values are converted to lower case.

    You should not use tolower or change string:

    [string tolower [HTTP::uri]] starts_with "/microsoft-server-activesync"
    • MR_Freddy's avatar
      MR_Freddy
      Icon for Nimbostratus rankNimbostratus

      Thank you for your reply , so my irule is correct after modifying this part ?

      • Hi,

        I think it will work correctly when you also change the following line.

        set test [URI::query [HTTP::uri] DeviceNo]