Hostnames and Wildcards?

2 posts, 0 answers
  1. Derek
    Derek avatar
    1 posts
    Member since:
    Jun 2015

    Posted 22 Jun 2015 Link to this post

     Currently I have Fiddler's Host Remapping feature configured like so:     *     *     *     *     *     *
     *     *     *     *     *     *     *
                           *     *     *     *     *     *     *

    How can I use a wildcard for the Top Level Domain?

    I tried to use the code below in the Fiddler Rules script's OnBeforeRequest() but am not having success. How can this be done?

    if ('.websiteB.')) {
        oSession.m_hostIP= '';
       // MessageBox.Show(oSession);         


  2. Eric Lawrence
    Eric Lawrence avatar
    833 posts

    Posted 23 Jun 2015 Link to this post

    Hello, Derek--

    I'm not sure if your example is using made up names? If not, the most direct problem is that .Contains is a case-sensitive function, but the hostnames sent by clients are almost always in lowercase. Hence, asking if a hostname contains any string containing uppercase letters will almost always return false.

    Your code should look like this:

      if ('.websiteb.')) {
        oSession["X-OverrideHost"] = '';

    Eric Lawrence
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top