Remove default.aspx from Orchard.web

It hasn't been needed since MVC2, and it now broken with MVC3.

--HG--
branch : dev
extra : transplant_source : N%CA%B4%F6%13%9C%BE%2AL%14z_%13%A9%90cF%00%DCn
This commit is contained in:
Renaud Paquay
2010-12-10 21:09:53 -08:00
parent a4e824fb4a
commit 3bbdac0eb6
9 changed files with 135 additions and 187 deletions

View File

@@ -184,7 +184,7 @@ Scenario: I set my blog to be the content for the home page and the posts for th
| Body.Text | Hi there. | | Body.Text | Hi there. |
And I hit "Publish Now" And I hit "Publish Now"
And I am redirected And I am redirected
And I go to "/Default.aspx" And I go to "/"
Then I should see "<h1>My Blog</h1>" Then I should see "<h1>My Blog</h1>"
When I go to "/my-blog" When I go to "/my-blog"
Then the status should be 404 "Not Found" Then the status should be 404 "Not Found"

View File

@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/). // This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.4.0.0 // SpecFlow Version:1.3.2.0
// Runtime Version:4.0.30319.1 // Runtime Version:4.0.30319.1
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
@@ -14,7 +14,7 @@ namespace Orchard.Specs
using TechTalk.SpecFlow; using TechTalk.SpecFlow;
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.2.0")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Blog")] [NUnit.Framework.DescriptionAttribute("Blog")]
@@ -31,7 +31,7 @@ namespace Orchard.Specs
{ {
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Blog", "In order to add blogs to my site\r\nAs an author\r\nI want to create blogs and create" + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Blog", "In order to add blogs to my site\r\nAs an author\r\nI want to create blogs and create" +
", publish and edit blog posts", GenerationTargetLanguage.CSharp, ((string[])(null))); ", publish and edit blog posts", ((string[])(null)));
testRunner.OnFeatureStart(featureInfo); testRunner.OnFeatureStart(featureInfo);
} }
@@ -547,7 +547,7 @@ this.ScenarioSetup(scenarioInfo);
#line 186 #line 186
testRunner.And("I am redirected"); testRunner.And("I am redirected");
#line 187 #line 187
testRunner.And("I go to \"/Default.aspx\""); testRunner.And("I go to \"/\"");
#line 188 #line 188
testRunner.Then("I should see \"<h1>My Blog</h1>\""); testRunner.Then("I should see \"<h1>My Blog</h1>\"");
#line 189 #line 189

View File

@@ -1 +0,0 @@
<%@ Page AutoEventWireup="true" Inherits="Orchard.Specs.Hosting.Orchard.Web._Default, Orchard.Specs" %>

View File

@@ -1,20 +0,0 @@
using System;
using System.Web;
using System.Web.Mvc;
using System.Web.UI;
namespace Orchard.Specs.Hosting.Orchard.Web {
public class _Default : Page {
public void Page_Load(object sender, EventArgs e) {
// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).
var originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}
}

View File

@@ -74,6 +74,9 @@ namespace Orchard.Specs.Hosting {
} }
private static string StripVDir(string urlPath, string virtualDirectory) { private static string StripVDir(string urlPath, string virtualDirectory) {
if (urlPath == "/")
return urlPath;
return urlPath.StartsWith(virtualDirectory, StringComparison.OrdinalIgnoreCase) return urlPath.StartsWith(virtualDirectory, StringComparison.OrdinalIgnoreCase)
? urlPath.Substring(virtualDirectory.Length) ? urlPath.Substring(virtualDirectory.Length)
: urlPath; : urlPath;

View File

@@ -203,9 +203,6 @@
<Compile Include="Hosting\WebHostAgent.cs" /> <Compile Include="Hosting\WebHostAgent.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Bindings\SanityCheck.cs" /> <Compile Include="Bindings\SanityCheck.cs" />
<Compile Include="Hosting\Orchard.Web\_Default.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebHosting.feature.cs"> <Compile Include="WebHosting.feature.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
@@ -332,9 +329,6 @@
<Content Include="Hosting\Simple.Web\Content\Static.txt"> <Content Include="Hosting\Simple.Web\Content\Static.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Hosting\Orchard.Web\Default.aspx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Hosting\Orchard.Web\Global.asax"> <Content Include="Hosting\Orchard.Web\Global.asax">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>

View File

@@ -1,3 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Orchard.Web._Default" %>
<%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%>

View File

@@ -1,20 +0,0 @@
using System;
using System.Web;
using System.Web.Mvc;
using System.Web.UI;
namespace Orchard.Web {
public class _Default : Page {
public void Page_Load(object sender, EventArgs e) {
// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).
var originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}
}

View File

@@ -118,10 +118,6 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Global.asax.cs"> <Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon> <DependentUpon>Global.asax</DependentUpon>
</Compile> </Compile>
@@ -130,7 +126,6 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Default.aspx" />
<Content Include="Global.asax" /> <Content Include="Global.asax" />
<Content Include="Media\OrchardLogo.png" /> <Content Include="Media\OrchardLogo.png" />
<Content Include="Refresh.html" /> <Content Include="Refresh.html" />