Exemplo n.º 1
0
 public HttpRequest(IHttpUserLookup userLookup, IOwinRequest request, HttpContextSettings settings)
 {
     this.request     = request;
     this.settings    = settings;
     this.userLookup  = userLookup;
     this.currentUser = new OneTryLazy <IHttpUser>(() => new HttpUser(HttpUser.NullUserName));
 }
Exemplo n.º 2
0
        public HttpCookieCollection(RequestCookieCollection cookies, HttpContextSettings settings)
            : base(cookie => cookie.Name)
        {
            var str = string.Format("/{0}/", settings.SecureCookiePrefix);

            cookies.Where(cookie => !cookie.Value.StartsWith(str, StringComparison.Ordinal))
            .Select(x => new HttpCookie(x.Key, x.Value))
            .ToList()
            .ForEach(this.Add);
        }
Exemplo n.º 3
0
        public HttpContext(
            IApplication application,
            ILogger logger,
            IHttpUserLookup userLookup,
            IOwinContext context,
            HttpContextSettings settings)
        {
            application.Validate().IsNotNull();
            logger.Validate().IsNotNull();
            context.Validate().IsNotNull();
            settings.Validate().IsNotNull();
            this.application = application;
            this.logger      = logger;
            this.userLookup  = userLookup;
            this.context     = context;
            this.settings    = settings;

            this.httpSession  = new HttpSession(this.context);
            this.httpFlash    = new HttpFlash(this.context);
            this.httpRequest  = new HttpRequest(this.userLookup, this.context.Request, this.settings);
            this.httpResponse = new HttpResponse(this.context.Response, this.settings);
            this.cookieJar    = new RetryLazy <SecureCookieJarBase <KeyValuePair <string, string> > >(() => new OwinCookieJar(this.context, this.CookieJarSettings()));
        }
Exemplo n.º 4
0
 public HttpResponse(IOwinResponse response, HttpContextSettings settings)
 {
     this.response = response;
     this.settings = settings;
 }
Exemplo n.º 5
0
 public HttpRequestBody(IOwinRequest request, HttpContextSettings settings)
 {
     this.request  = request;
     this.settings = settings;
 }