Jump to content


Photo

Responder policy to eliminate the double slash, triple slash and so on in the url

Started by Samarjit Das , 06 April 2017 - 01:40 PM
2 replies to this topic

Best Answer Sven Jansen , 11 April 2017 - 08:39 AM

What about something like

http.req.hostname.settextmode(IGNORECASE).eq("test..com") && http.req.URL.settextmode(IGNORECASE).CONTAINS("api") && http.req.URL.settextmode(IGNORECASE).CONTAINS("1.1") && http.req.URL.settextmode(IGNORECASE).CONTAINS("abc")

?

Samarjit Das Members

Samarjit Das
  • 13 posts

Posted 06 April 2017 - 01:40 PM

We have an url https://test..com/api/1.1/abc which has been set to send a http code 404 using filter policy. The policy is working fine but putting // or ///  on url (https://test..com//api/1.1/abc) doesn't execute the filter policy.What type of policy we can set in LB to send http code 404 for all cases 

 



Paul Blitz Members

Paul Blitz
  • 3,915 posts

Posted 10 April 2017 - 12:15 PM

Sounds like you need to look at using RegEx in your policies, so you can use something along the lines of "/+", to match one or more instances of the "/"...

 

I guess a lot depends on hw specific you need to be: how "deep" are you looking for the match to go, and what are you looking for? - there might be other ways to match what you need.



Sven Jansen Members

Sven Jansen
  • 45 posts

Posted 11 April 2017 - 08:39 AM

What about something like

http.req.hostname.settextmode(IGNORECASE).eq("test..com") && http.req.URL.settextmode(IGNORECASE).CONTAINS("api") && http.req.URL.settextmode(IGNORECASE).CONTAINS("1.1") && http.req.URL.settextmode(IGNORECASE).CONTAINS("abc")

?


Best Answer