Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EssentialCSharp.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private static void Main(string[] args)
builder.Services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders =
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost;

// Only loopback proxies are allowed by default.
// Clear that restriction because forwarders are enabled by explicit
Expand Down
9 changes: 8 additions & 1 deletion EssentialCSharp.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@
const string imageUrl = "https://essentialcsharp.com/images/icon.png";
const string description = "Accelerate your development knowledge with C# expert Mark Michaelis and Benjamin Michaelis' free, online comprehensive C# tutorial and reference that is updated through C# 11.0";
string title = $"Essential C#{(string.IsNullOrEmpty(ViewBag.PageTitle) ? string.Empty : $": {ViewBag.PageTitle}")}";
string canonicalPath = $"{Context.Request.PathBase}{Context.Request.Path}";
if (string.IsNullOrEmpty(canonicalPath))
{
canonicalPath = "/";
}
string canonicalUrl = $"{Context.Request.Scheme}://{Context.Request.Host}{canonicalPath}";
}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://essentialcsharp.com/" />
<meta property="og:url" content="@canonicalUrl" />
<meta property="og:image:secure_url" content="@imageUrl" />
<meta property="og:image" content="@imageUrl" />
<meta name="twitter:image" content="@imageUrl" />
Expand Down Expand Up @@ -87,6 +93,7 @@
<script src="~/js/hcaptcha-form.js" asp-append-version="true"></script>
<!-- hCaptcha Script -->
<script src="https://js.hcaptcha.com/1/api.js?render=explicit&onload=ecsOnHcaptchaLoad" async defer></script>
<link rel="canonical" href="@canonicalUrl" />
@await RenderSectionAsync("HeadAppend", required: false)
</head>
<body>
Expand Down