Skip to content

Commit 02ef891

Browse files
committed
Revert to initial project template
1 parent 574987d commit 02ef891

File tree

11 files changed

+2
-607
lines changed

11 files changed

+2
-607
lines changed
Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Configuration;
3-
using System.Text.RegularExpressions;
4-
using System.Web;
1+
using System.Web;
52
using System.Web.Mvc;
63

74
namespace RandomWebApp
@@ -12,35 +9,5 @@ public static void RegisterGlobalFilters(GlobalFilterCollection filters)
129
{
1310
filters.Add(new HandleErrorAttribute());
1411
}
15-
16-
public static void ValidateUrlScheme(HttpApplication app)
17-
{
18-
if (!app.Request.IsSecureConnection &&
19-
RequireHttps &&
20-
!string.Equals(app.Request.Url.Host, "localhost", StringComparison.InvariantCultureIgnoreCase))
21-
{
22-
// Uri.OriginalString プロパティを使用すると、:80 が追加されてしまうことがあります。
23-
var secureUrl = Regex.Replace(app.Request.Url.AbsoluteUri, @"^\w+(?=://)", Uri.UriSchemeHttps);
24-
25-
if (PermanentHttps)
26-
{
27-
app.Response.RedirectPermanent(secureUrl, true);
28-
}
29-
else
30-
{
31-
app.Response.Redirect(secureUrl, true);
32-
}
33-
}
34-
}
35-
36-
static bool RequireHttps
37-
{
38-
get { return Convert.ToBoolean(ConfigurationManager.AppSettings["app:RequireHttps"]); }
39-
}
40-
41-
static bool PermanentHttps
42-
{
43-
get { return Convert.ToBoolean(ConfigurationManager.AppSettings["app:PermanentHttps"]); }
44-
}
4512
}
4613
}

RandomGenerator/RandomWebApp/App_Start/RouteConfig.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ public static void RegisterRoutes(RouteCollection routes)
1313
{
1414
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
1515

16-
routes.MapMvcAttributeRoutes();
17-
1816
routes.MapRoute(
1917
name: "Default",
2018
url: "{controller}/{action}/{id}",

RandomGenerator/RandomWebApp/Controllers/HomeController.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

RandomGenerator/RandomWebApp/Controllers/RandomController.cs

Lines changed: 0 additions & 95 deletions
This file was deleted.

RandomGenerator/RandomWebApp/Global.asax.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,5 @@ protected void Application_Start()
2020
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
2121
RouteConfig.RegisterRoutes(RouteTable.Routes);
2222
}
23-
24-
void Application_BeginRequest(object sender, EventArgs e)
25-
{
26-
FilterConfig.ValidateUrlScheme(this);
27-
}
2823
}
2924
}

RandomGenerator/RandomWebApp/HtmlEx.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

RandomGenerator/RandomWebApp/JsonApiController.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

RandomGenerator/RandomWebApp/RandomWebApp.csproj

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,9 @@
116116
</Reference>
117117
</ItemGroup>
118118
<ItemGroup>
119-
<Compile Include="Controllers\HomeController.cs" />
120-
<Compile Include="Controllers\RandomController.cs" />
121119
<Compile Include="Global.asax.cs">
122120
<DependentUpon>Global.asax</DependentUpon>
123121
</Compile>
124-
<Compile Include="HtmlEx.cs" />
125-
<Compile Include="JsonApiController.cs" />
126122
<Compile Include="Properties\AssemblyInfo.cs" />
127123
</ItemGroup>
128124
<ItemGroup>
@@ -141,26 +137,12 @@
141137
</ItemGroup>
142138
<ItemGroup>
143139
<Folder Include="App_Data\" />
140+
<Folder Include="Controllers\" />
144141
<Folder Include="Models\" />
145142
</ItemGroup>
146143
<ItemGroup>
147144
<Content Include="packages.config" />
148145
</ItemGroup>
149-
<ItemGroup>
150-
<Content Include="Views\Home\Index.cshtml" />
151-
</ItemGroup>
152-
<ItemGroup>
153-
<ProjectReference Include="..\RandomLib\RandomLib.csproj">
154-
<Project>{c5ba44d2-4dd0-47d2-9d08-ce2c2783a95f}</Project>
155-
<Name>RandomLib</Name>
156-
</ProjectReference>
157-
</ItemGroup>
158-
<ItemGroup>
159-
<Content Include="Views\Home\JsonTest.cshtml" />
160-
</ItemGroup>
161-
<ItemGroup>
162-
<Content Include="Views\Home\JsonpTest.cshtml" />
163-
</ItemGroup>
164146
<PropertyGroup>
165147
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
166148
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

0 commit comments

Comments
 (0)