public
Created

  • Download Gist
HttpContextProxy.cs
C#
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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
using System;
using System.Collections;
using System.Globalization;
using System.Security.Principal;
using System.Web;
using System.Web.Caching;
using System.Web.Profile;
using System.Web.SessionState;
 
public abstract class HttpContextProxy : HttpContextBase
{
private readonly HttpContextBase _innerHttpContext;
 
protected HttpContextProxy(HttpContextBase innerHttpContext)
{
_innerHttpContext = innerHttpContext;
}
 
public override void AddError(Exception errorInfo)
{
_innerHttpContext.AddError(errorInfo);
}
 
public override Exception[] AllErrors
{
get
{
return _innerHttpContext.AllErrors;
}
}
 
public override HttpApplicationStateBase Application
{
get
{
return _innerHttpContext.Application;
}
}
 
public override HttpApplication ApplicationInstance
{
get
{
return _innerHttpContext.ApplicationInstance;
}
set
{
_innerHttpContext.ApplicationInstance = value;
}
}
 
public override Cache Cache
{
get
{
return _innerHttpContext.Cache;
}
}
 
public override void ClearError()
{
_innerHttpContext.ClearError();
}
 
public override IHttpHandler CurrentHandler
{
get
{
return _innerHttpContext.CurrentHandler;
}
}
 
public override RequestNotification CurrentNotification
{
get
{
return _innerHttpContext.CurrentNotification;
}
}
 
public override Exception Error
{
get
{
return _innerHttpContext.Error;
}
}
 
public override object GetGlobalResourceObject(string classKey, string resourceKey)
{
return _innerHttpContext.GetGlobalResourceObject(classKey, resourceKey);
}
 
public override object GetGlobalResourceObject(string classKey, string resourceKey, CultureInfo culture)
{
return _innerHttpContext.GetGlobalResourceObject(classKey, resourceKey, culture);
}
 
public override object GetLocalResourceObject(string virtualPath, string resourceKey)
{
return _innerHttpContext.GetLocalResourceObject(virtualPath, resourceKey);
}
 
public override object GetLocalResourceObject(string virtualPath, string resourceKey, CultureInfo culture)
{
return _innerHttpContext.GetLocalResourceObject(virtualPath, resourceKey, culture);
}
 
public override object GetSection(string sectionName)
{
return _innerHttpContext.GetSection(sectionName);
}
 
public override object GetService(Type serviceType)
{
return _innerHttpContext.GetService(serviceType);
}
 
public override IHttpHandler Handler
{
get
{
return _innerHttpContext.Handler;
}
set
{
_innerHttpContext.Handler = value;
}
}
 
public override bool IsCustomErrorEnabled
{
get
{
return _innerHttpContext.IsCustomErrorEnabled;
}
}
 
public override bool IsDebuggingEnabled
{
get
{
return _innerHttpContext.IsDebuggingEnabled;
}
}
 
public override bool IsPostNotification
{
get
{
return _innerHttpContext.IsPostNotification;
}
}
 
public override IDictionary Items
{
get
{
return _innerHttpContext.Items;
}
}
 
public override IHttpHandler PreviousHandler
{
get
{
return _innerHttpContext.PreviousHandler;
}
}
 
public override ProfileBase Profile
{
get
{
return _innerHttpContext.Profile;
}
}
 
public override void RemapHandler(IHttpHandler handler)
{
_innerHttpContext.RemapHandler(handler);
}
 
public override HttpRequestBase Request
{
get
{
return _innerHttpContext.Request;
}
}
 
public override HttpResponseBase Response
{
get
{
return _innerHttpContext.Response;
}
}
 
public override void RewritePath(string filePath, string pathInfo, string queryString)
{
_innerHttpContext.RewritePath(filePath, pathInfo, queryString);
}
 
public override void RewritePath(string filePath, string pathInfo, string queryString, bool setClientFilePath)
{
_innerHttpContext.RewritePath(filePath, pathInfo, queryString, setClientFilePath);
}
 
public override void RewritePath(string path)
{
_innerHttpContext.RewritePath(path);
}
 
public override void RewritePath(string path, bool rebaseClientPath)
{
_innerHttpContext.RewritePath(path, rebaseClientPath);
}
 
public override HttpServerUtilityBase Server
{
get
{
return _innerHttpContext.Server;
}
}
 
public override HttpSessionStateBase Session
{
get
{
return _innerHttpContext.Session;
}
}
 
public override void SetSessionStateBehavior(SessionStateBehavior sessionStateBehavior)
{
_innerHttpContext.SetSessionStateBehavior(sessionStateBehavior);
}
 
public override bool SkipAuthorization
{
get
{
return _innerHttpContext.SkipAuthorization;
}
set
{
_innerHttpContext.SkipAuthorization = value;
}
}
 
public override DateTime Timestamp
{
get
{
return _innerHttpContext.Timestamp;
}
}
 
public override TraceContext Trace
{
get
{
return _innerHttpContext.Trace;
}
}
 
public override IPrincipal User
{
get
{
return _innerHttpContext.User;
}
set
{
_innerHttpContext.User = value;
}
}
}
HttpRequestProxy.cs
C#
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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
using System;
using System.Collections.Specialized;
using System.IO;
using System.Security.Authentication.ExtendedProtection;
using System.Security.Principal;
using System.Text;
using System.Web;
using System.Web.Routing;
 
public abstract class HttpRequestProxy : HttpRequestBase
{
private readonly HttpRequestBase _innerHttpRequest;
 
public HttpRequestProxy(HttpRequestBase innerHttpRequest)
{
_innerHttpRequest = innerHttpRequest;
}
 
public override string[] AcceptTypes
{
get
{
return _innerHttpRequest.AcceptTypes;
}
}
 
public override string AnonymousID
{
get
{
return _innerHttpRequest.AnonymousID;
}
}
 
public override string ApplicationPath
{
get
{
return _innerHttpRequest.ApplicationPath;
}
}
 
public override string AppRelativeCurrentExecutionFilePath
{
get
{
return _innerHttpRequest.AppRelativeCurrentExecutionFilePath;
}
}
 
public override byte[] BinaryRead(int count)
{
return _innerHttpRequest.BinaryRead(count);
}
 
public override HttpBrowserCapabilitiesBase Browser
{
get
{
return _innerHttpRequest.Browser;
}
}
 
public override HttpClientCertificate ClientCertificate
{
get
{
return _innerHttpRequest.ClientCertificate;
}
}
 
public override Encoding ContentEncoding
{
get
{
return _innerHttpRequest.ContentEncoding;
}
set
{
_innerHttpRequest.ContentEncoding = value;
}
}
 
public override int ContentLength
{
get
{
return _innerHttpRequest.ContentLength;
}
}
 
public override string ContentType
{
get
{
return _innerHttpRequest.ContentType;
}
set
{
_innerHttpRequest.ContentType = value;
}
}
 
public override HttpCookieCollection Cookies
{
get
{
return _innerHttpRequest.Cookies;
}
}
 
public override string CurrentExecutionFilePath
{
get
{
return _innerHttpRequest.CurrentExecutionFilePath;
}
}
 
public override string FilePath
{
get
{
return _innerHttpRequest.FilePath;
}
}
 
public override HttpFileCollectionBase Files
{
get
{
return _innerHttpRequest.Files;
}
}
 
public override Stream Filter
{
get
{
return _innerHttpRequest.Filter;
}
set
{
_innerHttpRequest.Filter = value;
}
}
 
public override NameValueCollection Form
{
get
{
return _innerHttpRequest.Form;
}
}
 
public override NameValueCollection Headers
{
get
{
return _innerHttpRequest.Headers;
}
}
 
public override ChannelBinding HttpChannelBinding
{
get
{
return _innerHttpRequest.HttpChannelBinding;
}
}
 
public override string HttpMethod
{
get
{
return _innerHttpRequest.HttpMethod;
}
}
 
public override Stream InputStream
{
get
{
return _innerHttpRequest.InputStream;
}
}
 
public override bool IsAuthenticated
{
get
{
return _innerHttpRequest.IsAuthenticated;
}
}
 
public override bool IsLocal
{
get
{
return _innerHttpRequest.IsLocal;
}
}
 
public override bool IsSecureConnection
{
get
{
return _innerHttpRequest.IsSecureConnection;
}
}
 
public override WindowsIdentity LogonUserIdentity
{
get
{
return _innerHttpRequest.LogonUserIdentity;
}
}
 
public override int[] MapImageCoordinates(string imageFieldName)
{
return _innerHttpRequest.MapImageCoordinates(imageFieldName);
}
 
public override string MapPath(string virtualPath)
{
return _innerHttpRequest.MapPath(virtualPath);
}
 
public override string MapPath(string virtualPath, string baseVirtualDir, bool allowCrossAppMapping)
{
return _innerHttpRequest.MapPath(virtualPath, baseVirtualDir, allowCrossAppMapping);
}
 
public override NameValueCollection Params
{
get
{
return _innerHttpRequest.Params;
}
}
 
public override string Path
{
get
{
return _innerHttpRequest.Path;
}
}
 
public override string PathInfo
{
get
{
return _innerHttpRequest.PathInfo;
}
}
 
public override string PhysicalApplicationPath
{
get
{
return _innerHttpRequest.PhysicalApplicationPath;
}
}
 
public override string PhysicalPath
{
get
{
return _innerHttpRequest.PhysicalPath;
}
}
 
public override NameValueCollection QueryString
{
get
{
return _innerHttpRequest.QueryString;
}
}
 
public override string RawUrl
{
get
{
return _innerHttpRequest.RawUrl;
}
}
 
public override RequestContext RequestContext
{
get
{
return _innerHttpRequest.RequestContext;
}
}
 
public override string RequestType
{
get
{
return _innerHttpRequest.RequestType;
}
set
{
_innerHttpRequest.RequestType = value;
}
}
 
public override void SaveAs(string filename, bool includeHeaders)
{
_innerHttpRequest.SaveAs(filename, includeHeaders);
}
 
public override NameValueCollection ServerVariables
{
get
{
return _innerHttpRequest.ServerVariables;
}
}
 
public override string this[string key]
{
get
{
return _innerHttpRequest[key];
}
}
 
public override int TotalBytes
{
get
{
return _innerHttpRequest.TotalBytes;
}
}
 
public override Uri Url
{
get
{
return _innerHttpRequest.Url;
}
}
 
public override Uri UrlReferrer
{
get
{
return _innerHttpRequest.UrlReferrer;
}
}
 
public override string UserAgent
{
get
{
return _innerHttpRequest.UserAgent;
}
}
 
public override string UserHostAddress
{
get
{
return _innerHttpRequest.UserHostAddress;
}
}
 
public override string UserHostName
{
get
{
return _innerHttpRequest.UserHostName;
}
}
 
public override string[] UserLanguages
{
get
{
return _innerHttpRequest.UserLanguages;
}
}
 
public override void ValidateInput()
{
_innerHttpRequest.ValidateInput();
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.