cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

Replace mutiple forward slash with one

Shyam_Shukla
Nimbostratus
Nimbostratus

Hello All,

 

I need to check if [HTTP::path] contains more than one forward slash (/) then replace all of them with single forward slash.

For e.g., if [HTTP::path] value comes as //abcd//xyz//abcd then it should get replaced with /abcd/xyz/abcd.

 

Thanks,

Shyam

 

 

 

3 REPLIES 3

Lidev
MVP
MVP

Hi Shyam Shukla,

 

You can use a Local Traffic Policies to do this.

0691T000008G9x1QAC.png

Shyam_Shukla
Nimbostratus
Nimbostratus

Thank you for sharing the details.

I am wondering how it would handle if more than 2 forward slash are found in URI , for e.g. ////abcd//xyz///abcd as it would just check for 2 forward slashes and in the request URI there could be 2, 3 ...n number of forward slashes? Can regex be put in condition block of Local Traffic Policies?

 

Thanks,

Shyam

Lidev
MVP
MVP

I think that the policy only check for 2 forward slashes and as far i kown, regex cannot be used in Local Traffic Policies.