Skip to content

Commit

Permalink
Removed HTTPS requirement for local server
Browse files Browse the repository at this point in the history
  • Loading branch information
Shojy committed Oct 8, 2018
1 parent 6b9cfcf commit 7d88558
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions Tseng/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ private static void StartServer(string[] args)

private static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseKestrel(opts => opts.ListenAnyIP(5000))
.UseStartup<Startup>();
}
}
10 changes: 1 addition & 9 deletions Tseng/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});


services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
Expand All @@ -47,10 +41,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}

app.UseHttpsRedirection();

app.UseStaticFiles();
app.UseCookiePolicy();

app.UseMvc(routes =>
{
Expand Down
3 changes: 2 additions & 1 deletion Tseng/Tseng.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net461</TargetFramework>
<DebugType>full</DebugType>
<ApplicationIcon>tseng.ico</ApplicationIcon>
<AutoGenerateBindingRedirects>False</AutoGenerateBindingRedirects>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,6 +13,7 @@
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>

</Project>

0 comments on commit 7d88558

Please sign in to comment.