Ejemplo n.º 1
0
        private static HttpServletRequest ToLowerCase(HttpServletRequest request)
        {
            IDictionary <string, string[]> original = (IDictionary <string, string[]>)request.GetParameterMap
                                                          ();

            if (!ParamFilter.ContainsUpperCase(original.Keys))
            {
                return(request);
            }
            IDictionary <string, IList <string> > m = new Dictionary <string, IList <string> >();

            foreach (KeyValuePair <string, string[]> entry in original)
            {
                string         key     = StringUtils.ToLowerCase(entry.Key);
                IList <string> strings = m[key];
                if (strings == null)
                {
                    strings = new AList <string>();
                    m[key]  = strings;
                }
                foreach (string v in entry.Value)
                {
                    strings.AddItem(v);
                }
            }
            return(new _HttpServletRequestWrapper_111(m, request));
        }
Ejemplo n.º 2
0
            public ContainerRequest Filter(ContainerRequest request)
            {
                MultivaluedMap <string, string> parameters = request.GetQueryParameters();

                if (ParamFilter.ContainsUpperCase(parameters.Keys))
                {
                    //rebuild URI
                    URI lower = ParamFilter.RebuildQuery(request.GetRequestUri(), parameters);
                    request.SetUris(request.GetBaseUri(), lower);
                }
                return(request);
            }