File tree Expand file tree Collapse file tree
OrchardCore.Transformalize Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # 0.19.3 <small >2026-04-29</small >
2+
3+ ## 🐛 Bug Fixes
4+ - Add forwarded headers middleware to ` Site/Program.cs ` so that links (e.g. download URLs) are
5+ generated with ` https:// ` when the app runs behind a reverse proxy such as an AWS ALB or Azure
6+ Application Gateway that terminates TLS. Without this, the container sees plain HTTP and generates
7+ ` http:// ` links, which can break downloads due to auth cookies being stripped on redirect.
8+
9+ <!-- CHANGELOG_BOUNDARY -->
10+
111# 0.19.2 <small >2026-04-29</small >
212
313## 💅 Improvements
Original file line number Diff line number Diff line change 33 <TargetFramework >net10.0</TargetFramework >
44 <AddRazorSupportForMvc >true</AddRazorSupportForMvc >
55 <RootNamespace >TransformalizeModule</RootNamespace >
6- <Version >0.19.1 </Version >
7- <FileVersion >0.19.1 </FileVersion >
8- <AssemblyVersion >0.19.1 </AssemblyVersion >
6+ <Version >0.19.3 </Version >
7+ <FileVersion >0.19.3 </FileVersion >
8+ <AssemblyVersion >0.19.3 </AssemblyVersion >
99 <GeneratePackageOnBuild >true</GeneratePackageOnBuild >
1010 <Authors >Dale Newman</Authors >
1111 <Copyright >Copyright © 2013-2026</Copyright >
Original file line number Diff line number Diff line change 1+ using Microsoft . AspNetCore . HttpOverrides ;
12using Serilog ;
23
34var builder = WebApplication . CreateBuilder ( args ) ;
3233 app . UseHsts ( ) ;
3334}
3435
36+ // Trust X-Forwarded-For and X-Forwarded-Proto headers so that generated links use the correct
37+ // scheme (https) when the app runs in a private subnet behind a public-facing reverse proxy
38+ // (e.g. AWS ALB, Azure Application Gateway). Without this, the container only sees http and
39+ // generates http:// links, which can cause auth cookies to be stripped on redirect and break
40+ // downloads. KnownIPNetworks/KnownProxies are cleared so any upstream proxy is trusted —
41+ // this is safe when the container is not directly reachable from the internet, but would allow
42+ // header spoofing if the app were exposed publicly without a proxy in front of it.
43+ var forwardedOptions = new ForwardedHeadersOptions {
44+ ForwardedHeaders = ForwardedHeaders . XForwardedFor | ForwardedHeaders . XForwardedProto
45+ } ;
46+ forwardedOptions . KnownIPNetworks . Clear ( ) ;
47+ forwardedOptions . KnownProxies . Clear ( ) ;
48+ app . UseForwardedHeaders ( forwardedOptions ) ;
49+
3550// app.UseHttpsRedirection();
3651app . UseStaticFiles ( ) ;
3752
You can’t perform that action at this time.
0 commit comments