Пример #1
0
 /// <summary>
 /// Tokenize Query Strings.. 
 /// </summary>
 /// <param name="s"></param>
 /// <returns></returns>
 public MatchCollection TokenizeQueryString(Session s)
 {
     MatchCollection mc = new MatchCollection();
     foreach (IQueryStringParser parser in queryStringParsers) {
         if (parser is ParserBase && UAUtilities.isMatch(((ParserBase)parser).ContentTypePatterns, s.Request.ContentType)) {
             mc.AddRange(parser.TokenizeQueryString(s));
         }
     }
     return mc;
 }
Пример #2
0
        public MatchCollection TokenizeRequest(Session oSession, bool bTokenizeQS, bool bTokenizeHeaders, bool bTokenizeBody)
        {
            MatchCollection mc = new MatchCollection();

            //Is there a query string on this session? check for the presences of ?
            //Essentually sanity checks.
            try
            {
                if (oSession.Request.Path.Contains("?") && bTokenizeQS)
                    mc.AddRange(TokenizeQueryString(oSession));

                if (oSession.Request.Headers.Count > 0 && bTokenizeHeaders)
                    mc.AddRange(TokenizeHeaders(oSession));

                if (oSession.Request.BodyBytes.Length > 0 && bTokenizeBody)
                    mc.AddRange(TokenizeBody(oSession));
            }
            catch
            {

                //Swallowing parsing exceptions.. Maybe display a error message at some point.
            }
            return mc;
        }