2 // HttpRequestWrapper.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
7 // Copyright (C) 2008 Novell Inc. http://novell.com
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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.
31 using System.Collections;
32 using System.Collections.Generic;
33 using System.Collections.Specialized;
34 using System.Globalization;
36 using System.Runtime.CompilerServices;
37 using System.Runtime.Serialization;
38 using System.Security.Permissions;
39 using System.Security.Principal;
41 using System.Web.Caching;
44 using System.Security.Authentication.ExtendedProtection;
45 using System.Web.Routing;
51 [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
53 [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
54 [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
55 public class HttpRequestWrapper : HttpRequestBase
59 public HttpRequestWrapper (HttpRequest httpRequest)
61 if (httpRequest == null)
62 throw new ArgumentNullException ("httpRequest");
66 public override string [] AcceptTypes {
67 get { return w.AcceptTypes; }
70 public override string AnonymousID {
71 get { return w.AnonymousID; }
74 public override string ApplicationPath {
75 get { return w.ApplicationPath; }
78 public override string AppRelativeCurrentExecutionFilePath {
79 get { return w.AppRelativeCurrentExecutionFilePath; }
82 public override HttpBrowserCapabilitiesBase Browser {
83 get { return new HttpBrowserCapabilitiesWrapper (w.Browser); }
86 public override HttpClientCertificate ClientCertificate {
87 get { return w.ClientCertificate; }
90 public override Encoding ContentEncoding {
91 get { return w.ContentEncoding; }
92 set { w.ContentEncoding = value; }
95 public override int ContentLength {
96 get { return w.ContentLength; }
99 public override string ContentType {
100 get { return w.ContentType; }
101 set { w.ContentType = value; }
104 public override HttpCookieCollection Cookies {
105 get { return w.Cookies; }
108 public override string CurrentExecutionFilePath {
109 get { return w.CurrentExecutionFilePath; }
112 public override string FilePath {
113 get { return w.FilePath; }
116 public override HttpFileCollectionBase Files {
117 get { return new HttpFileCollectionWrapper (w.Files); }
120 public override Stream Filter {
121 get { return w.Filter; }
122 set { w.Filter = value; }
125 public override NameValueCollection Form {
126 get { return w.Form; }
129 public override NameValueCollection Headers {
130 get { return w.Headers; }
133 public override string HttpMethod {
134 get { return w.HttpMethod; }
137 public override ChannelBinding HttpChannelBinding {
138 get { return w.HttpChannelBinding; }
141 public override Stream InputStream {
142 get { return w.InputStream; }
145 public override bool IsAuthenticated {
146 get { return w.IsAuthenticated; }
149 public override bool IsLocal {
150 get { return w.IsLocal; }
153 public override bool IsSecureConnection {
154 get { return w.IsSecureConnection; }
157 public override string this [string key] {
158 get { return w [key]; }
161 public override WindowsIdentity LogonUserIdentity {
162 get { return w.LogonUserIdentity; }
165 public override NameValueCollection Params {
166 get { return w.Params; }
169 public override string Path {
170 get { return w.Path; }
173 public override string PathInfo {
174 get { return w.PathInfo; }
177 public override string PhysicalApplicationPath {
178 get { return w.PhysicalApplicationPath; }
181 public override string PhysicalPath {
182 get { return w.PhysicalPath; }
185 public override NameValueCollection QueryString {
186 get { return w.QueryString; }
189 public override string RawUrl {
190 get { return w.RawUrl; }
193 public override string RequestType {
194 get { return w.RequestType; }
195 set { w.RequestType = value; }
198 public override RequestContext RequestContext {
199 get { return w.RequestContext; }
200 internal set { w.RequestContext = value; }
203 public override NameValueCollection ServerVariables {
204 get { return w.ServerVariables; }
207 public override int TotalBytes {
208 get { return w.TotalBytes; }
211 public override Uri Url {
212 get { return w.Url; }
215 public override Uri UrlReferrer {
216 get { return w.UrlReferrer; }
219 public override string UserAgent {
220 get { return w.UserAgent; }
223 public override string UserHostAddress {
224 get { return w.UserHostAddress; }
227 public override string UserHostName {
228 get { return w.UserHostName; }
231 public override string [] UserLanguages {
232 get { return w.UserLanguages; }
235 public override byte [] BinaryRead (int count)
237 return w.BinaryRead (count);
240 public override int [] MapImageCoordinates (string imageFieldName)
242 return w.MapImageCoordinates (imageFieldName);
245 public override string MapPath (string overridePath)
247 return w.MapPath (overridePath);
250 public override string MapPath (string overridePath, string baseVirtualDir, bool allowCrossAppMapping)
252 return w.MapPath (overridePath, baseVirtualDir, allowCrossAppMapping);
255 public override void SaveAs (string filename, bool includeHeaders)
257 w.SaveAs (filename, includeHeaders);
260 public override void ValidateInput ()