Fiddler Answering Machine + Regular Expression

I know that the name is not very descriptive, but here is something that I just can’t understand! So, I have something like the following URL:

http://realsite.com/Stuff/start.ashx?blah=blah1&RandomStuffHere&blah=false

Therefore, I need to either redirect it or provide it on my site:

http://My_Site.com/Stuff/newstart.ashx?blah=blah1&RandomStuffHere&blah=true

Implement how I kept everything the same, except for the domain that I changed for my own and the bool value at the end. I searched, and searched, and still can't find anything that works.

I am currently trying to use a REGEX solution, but that will not allow me to change the bool at the end. REGEX:.*/Stuff/start.ashx(.*)

So, if someone can provide something like this that allows me to redirect to my site with everything like a new URL, except for the bool change at the end, I will be forever in your debt !: D

Thank you in advance:)

+4
1

Fiddler, , , URL .

Alternative

FiddlerScript :

OnBeforeRequest

if (oSession.HostnameIs("realsite.com") && oSession.uriContains("Stuff/start.ashx")) {
    oSession.hostname = "My_Site.com";
    oSession.url = oSession.url.Replace("Stuff/start.ashx", "newstuff/start.ashx");
    oSession.url = oSession.url.Replace("&blah=false", "&blah=true");
}

100% , . URL-, , -, URL-.

: "" URL- , blah=false :

regex:(?insx)^http://realsite.com/Stuff/start.ashx?(.*)&blah=false$ #Match the query string always with blah=false at end

:

http://My_Site.com/Stuff/newstart.ashx?$1&blah=true

: Screen grab of regex in place in fiddler

+9

Source: https://habr.com/ru/post/1527226/


All Articles