コード例 #1
0
        // Token: 0x060004E9 RID: 1257 RVA: 0x0001B2AC File Offset: 0x000194AC
        private static string GetBackendFqdnFromE4eCookie(HttpRequest request, RequestDetailsLogger logger)
        {
            HttpCookie httpCookie = request.Cookies["X-E4eBackEnd"];

            if (httpCookie == null)
            {
                return(null);
            }
            string value = httpCookie.Value;

            if (string.IsNullOrEmpty(value))
            {
                logger.AppendGenericError("E4eBeCookieNullOrEmpty", "The E4E backend cookie hint was found but is null or empty.");
                return(null);
            }
            string[] array = httpCookie.Value.Split(new char[]
            {
                '~'
            });
            if (array.Length != 2)
            {
                logger.AppendGenericError("E4eBeCookieBadValue", string.Format("The E4E backend cookie hint was found but does not have expected value. Actual value [{0}]", value));
                return(null);
            }
            string value2           = array[0];
            string result           = array[1];
            string itemIdFromCookie = E4eProxyRequestHandler.GetItemIdFromCookie(request);

            if (string.IsNullOrEmpty(itemIdFromCookie) || !itemIdFromCookie.Equals(value2, StringComparison.OrdinalIgnoreCase))
            {
                logger.AppendGenericInfo("E4eBeCookieStale", string.Format("The E4E backend cookie hint was found but does not match current item id. Cookie value [{0}], current item ID [{1}]", value, itemIdFromCookie));
                return(null);
            }
            return(result);
        }
コード例 #2
0
        internal static Match TryMatch(Regex regex, string data, RequestDetailsLogger logger)
        {
            Match result = null;

            try
            {
                result = regex.Match(data);
            }
            catch (FormatException ex)
            {
                logger.AppendGenericError("Regex Exception", string.Format("Matching regex {0} - {1}", regex.ToString(), ex.ToString()));
            }
            catch (OverflowException ex2)
            {
                logger.AppendGenericError("Regex Exception", string.Format("Matching regex {0} - {1}", regex.ToString(), ex2.ToString()));
            }
            catch (ArgumentException ex3)
            {
                logger.AppendGenericError("Regex Exception", string.Format("Matching regex {0} - {1}", regex.ToString(), ex3.ToString()));
            }
            return(result);
        }
コード例 #3
0
        internal static string ParseIdentifier(Match match, string pattern, RequestDetailsLogger logger)
        {
            string result = null;

            try
            {
                result = match.Result(pattern);
            }
            catch (FormatException ex)
            {
                logger.AppendGenericError("Regex Exception", string.Format("Parsing {0} - {1}", match.ToString(), ex.ToString()));
            }
            catch (OverflowException ex2)
            {
                logger.AppendGenericError("Regex Exception", string.Format("Parsing {0} - {1}", match.ToString(), ex2.ToString()));
            }
            catch (ArgumentException ex3)
            {
                logger.AppendGenericError("Regex Exception", string.Format("Parsing {0} - {1}", match.ToString(), ex3.ToString()));
            }
            return(result);
        }