Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow a bypass to be set by the application #2

Merged
merged 1 commit into from

2 participants

@danielgindi

Allow a bypass to be set by the application.
using HttpContext.Items[@"Intelligencia.UrlRewriter.Bypass"] = true

I use this many time when I have an advanced application that is doing real neat stuff :-)
I found that odd that it still was not added to official Intelligencia.

@danielgindi danielgindi Allow a bypass to be set by the application,
using HttpContext.Items[@"Intelligencia.UrlRewriter.Bypass"] = true
f31ce18
@sethyates sethyates merged commit ee3b8b5 into sethyates:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 23, 2011
  1. @danielgindi

    Allow a bypass to be set by the application,

    danielgindi authored
    using HttpContext.Items[@"Intelligencia.UrlRewriter.Bypass"] = true
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/RewriterHttpModule.cs
View
11 src/RewriterHttpModule.cs
@@ -52,7 +52,16 @@ private void BeginRequest(object sender, EventArgs args)
{
// Add our PoweredBy header
// HttpContext.Current.Response.AddHeader(Constants.HeaderXPoweredBy, Configuration.XPoweredBy);
-
+
+ // Allow a bypass to be set up by the using application
+ HttpContext context = HttpContext.Current;
+ if (context.Items.Contains(@"Intelligencia.UrlRewriter.Bypass") &&
+ context.Items[@"Intelligencia.UrlRewriter.Bypass"] is bool &&
+ ((bool)context.Items[@"Intelligencia.UrlRewriter.Bypass"]))
+ {
+ // A bypass is set!
+ return;
+ }
_rewriter.Rewrite();
}
Something went wrong with that request. Please try again.