public static bool IsProtobufPacket(HTTPHeaders headers)
        {
            if (null == headers)
            {
                return(false);
            }

            return(null != headers && (headers.ExistsAndContains("Content-Type", "application/x-protobuf") || headers.ExistsAndContains("Content-Type", "application/x-google-protobuf")));
        }
示例#2
0
 public bool Match(HTTPHeaders matchHeaders)
 {
     if (HeadsFilter != null && HeadsFilter.Count > 0)
     {
         foreach (MyKeyValuePair <string, string> headFilter in HeadsFilter)
         {
             if (!matchHeaders.ExistsAndContains(headFilter.Key, headFilter.Value))
             {
                 return(false);
             }
         }
     }
     return(true);
 }