Merge pull request #1899 from saper/resgencond
[mono.git] / mcs / class / System.Web / System.Web / HttpRequestWrapper.cs
1 //
2 // HttpRequestWrapper.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2008 Novell Inc. http://novell.com
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 using System;
31 using System.Collections;
32 using System.Collections.Generic;
33 using System.Collections.Specialized;
34 using System.Globalization;
35 using System.IO;
36 using System.Runtime.CompilerServices;
37 using System.Runtime.Serialization;
38 using System.Security.Permissions;
39 using System.Security.Principal;
40 using System.Text;
41 using System.Threading;
42 using System.Web.Caching;
43
44 using System.Security.Authentication.ExtendedProtection;
45 using System.Web.Routing;
46
47 namespace System.Web
48 {
49         [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
50         [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
51         [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
52         public class HttpRequestWrapper : HttpRequestBase
53         {
54                 HttpRequest w;
55
56                 public HttpRequestWrapper (HttpRequest httpRequest)
57                 {
58                         if (httpRequest == null)
59                                 throw new ArgumentNullException ("httpRequest");
60                         w = httpRequest;
61                 }
62
63                 public override string [] AcceptTypes {
64                         get { return w.AcceptTypes; }
65                 }
66
67                 public override string AnonymousID {
68                         get { return w.AnonymousID; }
69                 }
70
71                 public override string ApplicationPath {
72                         get { return w.ApplicationPath; }
73                 }
74
75                 public override string AppRelativeCurrentExecutionFilePath {
76                         get { return w.AppRelativeCurrentExecutionFilePath; }
77                 }
78
79                 public override HttpBrowserCapabilitiesBase Browser {
80                         get { return new HttpBrowserCapabilitiesWrapper (w.Browser); }
81                 }
82
83                 public override HttpClientCertificate ClientCertificate {
84                         get { return w.ClientCertificate; }
85                 }
86
87                 public override Encoding ContentEncoding {
88                         get { return w.ContentEncoding; }
89                         set { w.ContentEncoding = value; }
90                 }
91
92                 public override int ContentLength {
93                         get { return w.ContentLength; }
94                 }
95
96                 public override string ContentType {
97                         get { return w.ContentType; }
98                         set { w.ContentType = value; }
99                 }
100
101                 public override HttpCookieCollection Cookies {
102                         get { return w.Cookies; }
103                 }
104
105                 public override string CurrentExecutionFilePath {
106                         get { return w.CurrentExecutionFilePath; }
107                 }
108
109                 public override string FilePath {
110                         get { return w.FilePath; }
111                 }
112
113                 public override HttpFileCollectionBase Files {
114                         get { return new HttpFileCollectionWrapper (w.Files); }
115                 }
116
117                 public override Stream Filter {
118                         get { return w.Filter; }
119                         set { w.Filter = value; }
120                 }
121
122                 public override NameValueCollection Form {
123                         get { return w.Form; }
124                 }
125
126                 public override NameValueCollection Headers {
127                         get { return w.Headers; }
128                 }
129
130                 public override Stream GetBufferedInputStream ()
131                 {
132                         return w.GetBufferedInputStream ();
133                 }
134
135                 public override Stream GetBufferlessInputStream ()
136                 {
137                         return w.GetBufferlessInputStream ();
138                 }
139
140                 public override Stream GetBufferlessInputStream (System.Boolean disableMaxRequestLength)
141                 {
142                         return w.GetBufferlessInputStream (disableMaxRequestLength);
143                 }
144
145                 public override string HttpMethod {
146                         get { return w.HttpMethod; }
147                 }
148                 public override ChannelBinding HttpChannelBinding {
149                         get { return w.HttpChannelBinding; }
150                 }
151                 public override Stream InputStream {
152                         get { return w.InputStream; }
153                 }
154
155                 public override bool IsAuthenticated {
156                         get { return w.IsAuthenticated; }
157                 }
158
159                 public override bool IsLocal {
160                         get { return w.IsLocal; }
161                 }
162
163                 public override bool IsSecureConnection {
164                         get { return w.IsSecureConnection; }
165                 }
166
167                 public override string this [string key] {
168                         get { return w [key]; }
169                 }
170
171                 public override WindowsIdentity LogonUserIdentity {
172                         get { return w.LogonUserIdentity; }
173                 }
174
175                 public override NameValueCollection Params {
176                         get { return w.Params; }
177                 }
178
179                 public override string Path {
180                         get { return w.Path; }
181                 }
182
183                 public override string PathInfo {
184                         get { return w.PathInfo; }
185                 }
186
187                 public override string PhysicalApplicationPath {
188                         get { return w.PhysicalApplicationPath; }
189                 }
190
191                 public override string PhysicalPath {
192                         get { return w.PhysicalPath; }
193                 }
194
195                 public override NameValueCollection QueryString {
196                         get { return w.QueryString; }
197                 }
198
199                 public override string RawUrl {
200                         get { return w.RawUrl; }
201                 }
202
203                 public override string RequestType {
204                         get { return w.RequestType; }
205                         set { w.RequestType = value; }
206                 }
207                 public override RequestContext RequestContext {
208                         get { return w.RequestContext; }
209                         set { w.RequestContext = value; }       
210                 }
211                 public override NameValueCollection ServerVariables {
212                         get { return w.ServerVariables; }
213                 }
214
215                 public virtual CancellationToken TimedOutToken {
216                         get { return w.TimedOutToken; }
217                 }
218
219                 public override int TotalBytes {
220                         get { return w.TotalBytes; }
221                 }
222
223                 public override UnvalidatedRequestValuesBase Unvalidated { 
224                         get { return new UnvalidatedRequestValuesWrapper (w.Unvalidated); } 
225                 }
226
227                 public override ReadEntityBodyMode ReadEntityBodyMode {
228                         get { return ReadEntityBodyMode.Classic; }
229                 }
230
231                 public override Uri Url {
232                         get { return w.Url; }
233                 }
234
235                 public override Uri UrlReferrer {
236                         get { return w.UrlReferrer; }
237                 }
238
239                 public override string UserAgent {
240                         get { return w.UserAgent; }
241                 }
242
243                 public override string UserHostAddress {
244                         get { return w.UserHostAddress; }
245                 }
246
247                 public override string UserHostName {
248                         get { return w.UserHostName; }
249                 }
250
251                 public override string [] UserLanguages {
252                         get { return w.UserLanguages; }
253                 }
254
255                 public void Abort ()
256                 {
257                         w.WorkerRequest.CloseConnection();
258                 }
259
260                 public override byte [] BinaryRead (int count)
261                 {
262                         return w.BinaryRead (count);
263                 }
264
265                 public override int [] MapImageCoordinates (string imageFieldName)
266                 {
267                         return w.MapImageCoordinates (imageFieldName);
268                 }
269
270                 public override string MapPath (string virtualPath)
271                 {
272                         return w.MapPath (virtualPath);
273                 }
274
275                 public override string MapPath (string virtualPath, string baseVirtualDir, bool allowCrossAppMapping)
276                 {
277                         return w.MapPath (virtualPath, baseVirtualDir, allowCrossAppMapping);
278                 }
279
280                 public override double [] MapRawImageCoordinates (System.String imageFieldName)
281                 {
282                         return w.MapRawImageCoordinates (imageFieldName);
283                 }
284
285                 public override void SaveAs (string filename, bool includeHeaders)
286                 {
287                         w.SaveAs (filename, includeHeaders);
288                 }
289
290                 public override void ValidateInput ()
291                 {
292                         w.ValidateInput ();
293                 }
294         }
295 }