Esempio n. 1
0
        /// <summary>
        /// Redirects the specified URL.
        /// </summary>
        /// <param name="url">The URL.</param>
        private void Redirect(string url)
        {
            IDisposable oldRequest  = request;
            IDisposable oldResponse = response;

            request  = SimpleHttpRequest.Create(url, response.Cookies, request.IsAuthenticated);
            response = SimpleHttpResponse.Create(Redirect);

            oldRequest.Dispose();
            oldResponse.Dispose();
        }
Esempio n. 2
0
        public SimpleHttpContext WithRequestsNotAuthenticated()
        {
            SimpleHttpContext newContext = new SimpleHttpContext(request.Url.ToString())
            {
                Session = SimpleHttpSession.Create(false),
                Request = SimpleHttpRequest.Create(request.Url.ToString(), request.Cookies, false)
            };

            request.Dispose();
            response.Dispose();
            return(newContext);
        }
Esempio n. 3
0
 private SimpleHttpContext(string requestUrl)
 {
     request  = SimpleHttpRequest.Create(requestUrl, new HttpCookieCollection(), true);
     response = SimpleHttpResponse.Create(Redirect);
     session  = SimpleHttpSession.Create(true);
 }