Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

detect cassinidev as well as cassini

fix for #257. now uses process detection to determine if running in
cassini or a drop in replacement such as cassinidev.
  • Loading branch information...
commit 48d14a98ebcd119250681fa544485b567c1cf1db 1 parent a423b7d
@willholley willholley authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/Cassette.Aspnet/CassetteHttpModule.cs
View
16 src/Cassette.Aspnet/CassetteHttpModule.cs
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Linq;
+using System.Security;
using System.Text.RegularExpressions;
using System.Web;
@@ -65,11 +66,16 @@ void HandleHttpApplicationEvents(HttpApplication httpApplication)
static bool IsRunningInCassini()
{
- return AppDomain.CurrentDomain
- .GetAssemblies()
- .Any(
- a => a.FullName.StartsWith("WebDev.WebHost")
- );
+ try
+ {
+ // detects cassini or drop in replacement cassinidev (which does not have a managed assembly we can sniff)
+ return Process.GetCurrentProcess().ProcessName.StartsWith("WebDev.WebServer");
+ }
+ catch(SecurityException)
+ {
+ // assume if not in full trust then we're not using cassini
+ return false;
+ }
}
void RewriteFileRequests()
Please sign in to comment.
Something went wrong with that request. Please try again.