Scratchpad using wrong host

5 posts, 1 answers
  1. Honey
    Honey avatar
    3 posts
    Member since:
    Mar 2015

    Posted 19 Mar 2015 Link to this post

    Not sure whether this is a bug or I'm doing something wrong:

    In composer's scratchpad, I have successfully issued a couple of requests to the same host (lets call it host1) with different paths and queries. Now I copy/paste one of those requests and edit it to point to host2 and also slightly change the path. I select this request in scratchpad and click "execute". The request is issued with the right path etc. but still using host1 instead of host2.

    Even updating and restarting Fiddler couldn't change this behavior. It's still using host1.

    Now what do i do?

    Thanks!
  2. Answer
    Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 19 Mar 2015 Link to this post

    Since you haven't provided any of the scratchpad text in question, I can only try to guess what might have been done incorrectly.

    My guess is that you updated only the URL but didn't properly change the HOST header on the request.

    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.

     
  3. Honey
    Honey avatar
    3 posts
    Member since:
    Mar 2015

    Posted 20 Mar 2015 in reply to Eric Lawrence Link to this post

    Argh, you're right! I only changed the topmost request line to host2, containing the GET URI part. The Host header still contained host1.

    However, the HTTP RFC states that the Host header must be ignored when an absolute URI is requested (http://tools.ietf.org/html/rfc2616#section-5.2). So, is this still a Fiddler issue? I imagine Fiddler acting as a proxy, forwarding the request to the wrong host. Don't know how it actually works.

    Here's an outline of how my request looked like:

    GET http://host2:8090/some/path/ HTTP/1.1
    Authorization: ...
    Accept-Encoding: gzip
    Accept: ...
    User-Agent: ...
    Host: host1:1080
    Connection: Keep-Alive
    Pragma: no-cache
  4. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 20 Mar 2015 Link to this post

    For security reasons, Fiddler forbids the Host header and URL Host to differ.

    In the default (traffic capture) case, any mismatch results in Fiddler showing a warning before overwriting the Host header with the Host specified by the URL.

    In the special case of the Composer, no warning is shown and the value in the Host header is used. At some point, things will probably be changed to make the Composer behave more like the traffic capture codepath.

    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.

     
  5. Honey
    Honey avatar
    3 posts
    Member since:
    Mar 2015

    Posted 23 Mar 2015 in reply to Eric Lawrence Link to this post

    I see.
    Thank you for solving my problem and for explaining the rationale behind it.
    Also, thank you for Fiddler, which is a great tool that solves 95% of my networking debugging issues where Wireshark was major overkill.
Back to Top