Skip to content

Instantly share code, notes, and snippets.

@jschementi
Created August 19, 2009 08:33
Show Gist options
  • Save jschementi/170251 to your computer and use it in GitHub Desktop.
Save jschementi/170251 to your computer and use it in GitHub Desktop.
diff --git a/Merlin/Main/Hosts/IronRuby.Rack/IIS.cs b/Merlin/Main/Hosts/IronRuby.Rack/IIS.cs
index 71d69a1..7ef07f7 100644
--- a/Merlin/Main/Hosts/IronRuby.Rack/IIS.cs
+++ b/Merlin/Main/Hosts/IronRuby.Rack/IIS.cs
@@ -56,11 +56,11 @@ namespace IronRuby.Rack.Handler {
// application knows its virtual "location". This may be an empty
// string, if the application corresponds to the "root" of the
// server.
// The SCRIPT_NAME, if non-empty, must start with /
- env["SCRIPT_NAME"] = request.OrigionalRequest.Path;
+ env["SCRIPT_NAME"] = request.OrigionalRequest.ApplicationPath;
if(env["SCRIPT_NAME"].ToString() != string.Empty && !((string)env["SCRIPT_NAME"]).StartsWith("/")) {
env["SCRIPT_NAME"] = "/" + env["SCRIPT_NAME"];
}
// SCRIPT_NAME never should be /, but instead be empty.
@@ -73,12 +73,15 @@ namespace IronRuby.Rack.Handler {
// within the application. This may be an empty string, if the
// request URL targets the application root and does not have a
// trailing slash. This value may be percent-encoded when I
// originating from a URL.
// The PATH_INFO, if non-empty, must start with /
-
- env["PATH_INFO"] = request.OrigionalRequest.PathInfo;
+
+ env["PATH_INFO"] = request.OrigionalRequest.Path.Substring(
+ request.OrigionalRequest.Path.IndexOf(request.OrigionalRequest.ApplicationPath) +
+ request.OrigionalRequest.ApplicationPath.Length
+ );
if(env["PATH_INFO"].ToString() != string.Empty && !((string)env["PATH_INFO"]).StartsWith("/")) {
env["PATH_INFO"] = "/" + env["PATH_INFO"];
}
// PATH_INFO should be / if SCRIPT_NAME is empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment