/// <summary> /// Initializes the request info. This method should be called when /// Initializing the class directly from the request. /// </summary> protected virtual void IntializeRequestInfo(HttpRequest httpRequest) { // If Modified Since // BUG: v5beta4 custom headers doesn't support at this moment // RequestInfo.CustomHeaders = GetHeadersFromRequest(httpRequest); RequestInfo.IfModifiedSince = GetIfModifiedSinceHeader(httpRequest); bool tmpBool = false; // Get requested url string url = httpRequest.QueryString[Consts.Query.UrlAddress]; // if url is provided if (!string.IsNullOrEmpty(url)) { string decode = httpRequest.QueryString[Consts.Query.Decode]; if (!string.IsNullOrEmpty(decode)) { try { tmpBool = Convert.ToBoolean(Convert.ToInt32(decode)); } catch { tmpBool = false; } } // If url is encoded, decode it if (tmpBool) { url = UrlProvider.DecodeUrl(url); } RequestInfo.RequestUrl = UrlProvider.CorrectInputUrl(url); } url = httpRequest.QueryString[Consts.Query.Redirect]; if (!string.IsNullOrEmpty(url)) { // If url is encoded, decode it if (tmpBool) { url = UrlProvider.DecodeUrl(url); } RequestInfo.RedirectedFrom = url; } // Get request post method state string reqMethod; if (UrlProvider.GetRequestQuery(httpRequest.QueryString, Consts.Query.WebMethod, out reqMethod)) { //RequestInfo.RequestMethod = WebMethods.ValidateMethod(reqMethod, WebMethods.DefaultMethods.GET); RequestInfo.RequestMethod = WebMethods.OmitInvalidCharacters(reqMethod); } else { RequestInfo.RequestMethod = WebMethods.GET; } }