Created
August 19, 2009 08:33
-
-
Save jschementi/170251 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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