forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpBatchContextWrapper.cs
More file actions
51 lines (44 loc) · 1.42 KB
/
HttpBatchContextWrapper.cs
File metadata and controls
51 lines (44 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections;
using System.Net.Http;
using System.Security.Principal;
using System.Web.Http.WebHost.Routing;
namespace System.Web.Http.WebHost
{
internal class HttpBatchContextWrapper : HttpContextBase
{
private HttpRequestMessageWrapper _httpRequestWrapper;
private HttpContextBase _httpContextBase;
private Hashtable _items;
public HttpBatchContextWrapper(HttpContextBase httpContext, HttpRequestMessage httpRequest)
{
_httpContextBase = httpContext;
_items = new Hashtable();
_httpRequestWrapper = new HttpRequestMessageWrapper(httpContext.Request.ApplicationPath, httpRequest);
}
public override HttpRequestBase Request
{
get { return _httpRequestWrapper; }
}
public override HttpResponseBase Response
{
get { return _httpContextBase.Response; }
}
public override IDictionary Items
{
get { return _items; }
}
public override IPrincipal User
{
get
{
return _httpContextBase.User;
}
set
{
_httpContextBase.User = value;
}
}
}
}