Can't change the response "for real".

2 posts, 0 answers
  1. Xuan
    Xuan avatar
    1 posts
    Member since:
    Feb 2015

    Posted 08 Feb 2015 Link to this post

    if ( (oSession.host=="203.104.209.55") && (oSession.PathAndQuery.indexOf("/kcsapi/api_port/port")>-1) ){
            oSession["ui-bold"]="true";
            oSession["x-breakresponse"]="true";
            oSession.utilSetResponseBody("");
    }

    Above is what is have in OnBeforeResponse function.

    However when I request this url,
    1. the session won't be paused
    2. although it shows in fiddler inspection that the response body is blank, I can still view the response body in my browser
    3. the ui-bold works :(

    If I enable the automatic breakpoint (alt+F11), and then continue the process. Both fiddler and my browser shows no response now.


  2. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 09 Feb 2015 Link to this post

    You have enabled streaming for this session in Fiddler (e.g. the STREAM button is depressed on Fiddler's toolbar, or it's a audio/video response and you have streaming enabled for those).

    You need to move your code to either OnBeforeRequest or OnPeekAtResponseHeaders and remove the line where you try to set the response body, or you need to configure bBufferResponse=true on this session in one of those two earlier handlers.

    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.

     
Back to Top