unable to change response body

5 posts, 0 answers
  1. Alex
    Alex avatar
    4 posts
    Member since:
    Oct 2015

    Posted 13 Oct 2015 Link to this post

    static function OnBeforeResponse(oSession: Session) {
            if (oSession.uriContains("google.com")) {
                FiddlerApplication.Log.LogString("before "+oSession.GetResponseBodyAsString());
                oSession.utilSetResponseBody("empty");
                FiddlerApplication.Log.LogString("after "+oSession.GetResponseBodyAsString());
            }
        }

     

    hi.

    i am trying to chage response body from third party website.

    in fiddler log i see that response body is changed, but browser receives unchanged response body.

    can anybody to help me with my issue?

  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 13 Oct 2015 Link to this post

    In 99% of the cases where someone reports this issue it turns out that they've configured the response body to stream to the client as it is read from the server (e.g. by pushing the STREAM button in Fiddler's toolbar). When that happens, the client is fed the blocks of the response as it is downloaded, and the event handler mentioned only executes after the response has already been returned.

    If you disable Streaming, it should work as you expect.

    Regards,
    Eric Lawrence
    Telerik
    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
  3. Alex
    Alex avatar
    4 posts
    Member since:
    Oct 2015

    Posted 13 Oct 2015 in reply to Eric Lawrence Link to this post

    oh, thanks, that is works
  4. Alex
    Alex avatar
    4 posts
    Member since:
    Oct 2015

    Posted 13 Oct 2015 in reply to Eric Lawrence Link to this post

    but i have another issue:

    i cannot access some sites with fiddler certificate, i got sec_error_unknown_issuer

    particularly in mozilla a dont have an option to add security exception.

  5. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 14 Oct 2015 Link to this post

    Hi,

    For browsers like IE and Chrome to trust Fiddler's root certificate, you must accept the prompt that is shown when you first enable HTTPS decryption inside Fiddler.

    For Firefox, which does not respect the Windows Certificate store, you must manually trust Fiddler's root certificate: http://www.telerik.com/blogs/configuring-firefox-for-fiddler

    Regards,
    Eric Lawrence
    Telerik
    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