This is a migrated thread and some comments may be shown as answers.

Hostname and wildcards

2 Answers 495 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
nasekt
Top achievements
Rank 1
nasekt asked on 20 Oct 2014, 08:36 PM

if (oSession.HostnameIs("www.google.co.uk") && oSession.uriContains("query")){
oSession["ui-color"]="orange";
oSession["ui-bold"]="true";
  oSession.oRequest.FailSession(404, "Blocked", "Fiddler blocked  file");}

The above script blocks only  www.google.co.uk, It does'nt work if there it's a different country code domain

for example 
www.google.co.br
www.google.co.cm

I tried using wildcards *.google.*, but it does not work. Any ideas?

Thank you

2 Answers, 1 is accepted

Sort by
0
Accepted
Eric Lawrence
Telerik team
answered on 20 Oct 2014, 09:04 PM
StackOverflow.com is a great place to ask general programming questions like "How do I perform a wildcard comparison of strings."

While domain names are much more complicated than you might expect, a simple approach would be for you to use:

  if (oSession.hostname.Contains(".google.")) { doWhatever(); }

Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
nasekt
Top achievements
Rank 1
answered on 20 Oct 2014, 09:15 PM
Sorry about that, I will keep that in mind 

Again, Thank you for helping me.
Tags
Fiddler Classic
Asked by
nasekt
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
nasekt
Top achievements
Rank 1
Share this question
or