예제 #1
0
        private static HttpHeaderInfo getHeaderInfo(string name)
        {
            HttpHeaderInfo info2;

            using (Dictionary <string, HttpHeaderInfo> .ValueCollection.Enumerator enumerator = _headers.Values.GetEnumerator())
            {
                while (true)
                {
                    if (enumerator.MoveNext())
                    {
                        HttpHeaderInfo current = enumerator.Current;
                        if (!current.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase))
                        {
                            continue;
                        }
                        info2 = current;
                    }
                    else
                    {
                        return(null);
                    }
                    break;
                }
            }
            return(info2);
        }
예제 #2
0
        internal static bool IsMultiValue(string headerName, bool response)
        {
            bool flag;

            if ((headerName == null ? false : headerName.Length != 0))
            {
                HttpHeaderInfo headerInfo = WebHeaderCollection.getHeaderInfo(headerName);
                flag = (headerInfo == null ? false : headerInfo.IsMultiValue(response));
            }
            else
            {
                flag = false;
            }
            return(flag);
        }
예제 #3
0
        private static HttpHeaderType checkHeaderType(string name)
        {
            HttpHeaderType httpHeaderType;
            HttpHeaderInfo headerInfo = WebHeaderCollection.getHeaderInfo(name);

            if (headerInfo == null)
            {
                httpHeaderType = HttpHeaderType.Unspecified;
            }
            else if (!headerInfo.IsRequest || headerInfo.IsResponse)
            {
                httpHeaderType = (headerInfo.IsRequest || !headerInfo.IsResponse ? HttpHeaderType.Unspecified : HttpHeaderType.Response);
            }
            else
            {
                httpHeaderType = HttpHeaderType.Request;
            }
            return(httpHeaderType);
        }
예제 #4
0
 static bool TryGetHeaderInfo(string name, out HttpHeaderInfo info)
 {
     info = GetHeaderInfo (name);
     return info != null;
 }
예제 #5
0
        private static HttpHeaderType checkHeaderType(string name)
        {
            HttpHeaderInfo headerInfo = getHeaderInfo(name);

            return((headerInfo != null) ? ((headerInfo.IsRequest && !headerInfo.IsResponse) ? HttpHeaderType.Request : ((!headerInfo.IsRequest && headerInfo.IsResponse) ? HttpHeaderType.Response : HttpHeaderType.Unspecified)) : HttpHeaderType.Unspecified);
        }
예제 #6
0
        private static bool isRestricted(string name, bool response)
        {
            HttpHeaderInfo headerInfo = WebHeaderCollection.getHeaderInfo(name);

            return(headerInfo == null ? false : headerInfo.IsRestricted(response));
        }
예제 #7
0
 static bool TryGetHeaderInfo(string name, out HttpHeaderInfo info)
 {
     info = GetHeaderInfo (name);
     return info.IsNull ()
            ? false
            : true;
 }
예제 #8
0
        private static HttpHeaderType checkHeaderType(string name)
        {
            HttpHeaderInfo info = getHeaderInfo(name);

            return((info != null) ? ((!info.IsRequest || info.IsResponse) ? ((info.IsRequest || !info.IsResponse) ? HttpHeaderType.Unspecified : HttpHeaderType.Response) : HttpHeaderType.Request) : HttpHeaderType.Unspecified);
        }
 private static bool TryGetHeaderInfo(string name, out HttpHeaderInfo info)
 {
     info = WebHeaderCollection.GetHeaderInfo(name);
     return(info != null);
 }