Skip to content

Commit

Permalink
Added some minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
VelizarVeli committed Sep 3, 2019
1 parent cdb967b commit 5520e6b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions Intillegio.Web/Intillegio.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="NWebsec.AspNetCore.Middleware" Version="2.0.0" />
</ItemGroup>


Expand Down
9 changes: 1 addition & 8 deletions Intillegio.Web/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace Intillegio.Web
{
Expand Down
11 changes: 11 additions & 0 deletions Intillegio.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Microsoft.AspNetCore.Identity.UI;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.EntityFrameworkCore;
Expand Down Expand Up @@ -84,6 +85,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddMvc(options =>
{
options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
options.Filters.Add(new RequireHttpsAttribute());
}).SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}

Expand All @@ -102,6 +104,15 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, IService
app.UseHsts();
}

app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});

app.UseHsts(options => options.MaxAge(days: 365).IncludeSubdomains());
app.UseXXssProtection(options => options.EnabledWithBlockMode());
app.UseXContentTypeOptions();

RoleSeeder.SeedRoles(serviceProvider);
app.UseHttpsRedirection();
app.UseStaticFiles();
Expand Down
6 changes: 3 additions & 3 deletions Intillegio.Web/Views/Home/PartialViews/Index/_BlogGrid.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor <br>incididunt ut labore et dolore magna aliqua.</p>
</div>
<div class="row mt-50">
@foreach (var article in Model.Articles.Take(3))
@foreach (var article in Model.Articles.Take(3).OrderByDescending(d => d.Date))
{
if (article.Content.Length > 100)
if (article.Content.Length > 110)
{
article.Content = article.Content.Substring(0, 120) + "...";
article.Content = article.Content.Substring(0, 113) + "...";
}
if (article.Name.Length > 26)
{
Expand Down
2 changes: 1 addition & 1 deletion Intillegio.Web/Views/Shared/_Footer.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h3>About Us</h3>
<div class="mt-25">
<p class="mt-25">
Intillegio Ltd offers high quality services and professional solutions to foreign companies which want to enter or to extend on the Romanian market.
Intillegio Ltd offers high quality services and professional solutions to foreign companies which want to enter or to extend their business on the Romanian market.
</p>
<div class="footer-social-icons mt-25">
<ul>
Expand Down

0 comments on commit 5520e6b

Please sign in to comment.