HTTP服务器软件系统的设计与实现(22)_毕业论文

毕业论文移动版

毕业论文 > 计算机论文 >

HTTP服务器软件系统的设计与实现(22)


                case "ico":
                case "png":
                    return MimeType.image_png;
                case "htm":
                case "html":
                case "xhtml":
                case "dhtml":
                    return MimeType.text_html;
                case "js":
                    return MimeType.text_javascript;
                case "xml":
                    return MimeType.multipart_xmixedreplace;
                default:
                    return MimeType.none;
            }
        }

        public static string CleanJsonString(string url)
        {
            if (url == null) return null;
            return url.Replace("%27", "\"").Replace("%35", "#").Replace("%20", " ").Replace("%61", "=").Replace("%63", "?");
        }

        public static string[] GetUrlQueries(string queryUrlString)
        {
            return queryUrlString.Split(new string[] { "&" }, StringSplitOptions.RemoveEmptyEntries);
        }

        #region Custom

     

        public static string RemoveToken(string completeReq)
        {
            if (completeReq.Contains("__"))
            {
                completeReq = completeReq.Split(new string[] { "__" }, StringSplitOptions.RemoveEmptyEntries)[0];
            }
            string[] _pReq = completeReq.Split(new string[] { "?" }, StringSplitOptions.RemoveEmptyEntries);
            if (_pReq.Length < 2) return string.Empty;
            else return _pReq[1]; (责任编辑:qin)