/// <summary> /// Ok this method is the main entry into request parsing and handling. /// </summary> /// <param name="s"></param> public void ProcessRequest(Session s) { //First we tell the engne to process the request.. returning us a match collection parsed based on the parsers. //This list contains all the offsets in the request where we will be replacing. MatchCollection mc = new MatchCollection(); if (settings.injectIntoPost || settings.injectIntoQueryString) { mc.AddRange(RequestEngine.ProcessSession(s)); } /* * This is where logic is introduced to do checking for canaries in the request. * */ //If we want to check for token presence in the request. (We can borrow the response parser to do this if (this.Settings.checkRequestForCanary) { if (s.Flags.ContainsKey(UASettings.casabaFlag) == false) { mc.AddRange(this.RequestEngine.LocateTokensInRequest(s, new Token(this.Settings.canary))); } } //Here we create the session objects to inject based on the matches returned from the processing. List <Session> sessions = GetRequestsToInject(s, mc); //Inject the sessions into the fiddler session.. this also transforms our session objects to fiddlers. if (sessions.Count > 0) { FiddlerUtils.InjectSessions(sessions); } }