-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ODS-5481] Improve use of X-Forwarded-XYZ headers (5.3) (#524)
* Allow X-Forward-Proto from Elasticbeanstalk * Determine rootUrl only once * Introduce appsettings for default X-Forwarded-Host and X-Forwarded-Port in case they are not included * Rename file * Tests for X-Forwarded-Host * Change to manual test; add instructions * Typo * Address review comments * Refactor to pass around an object with settings And to throw an exception for settings misconfiguration. * Refactor from "default" to "overrideFor" * Fix unit test Co-authored-by: Axel Marquez <[email protected]>
- Loading branch information
1 parent
92d760a
commit 6ae63dc
Showing
12 changed files
with
862 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
Application/EdFi.Ods.Common/Configuration/ReverseProxySettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
| ||
namespace EdFi.Ods.Common.Configuration | ||
{ | ||
public class ReverseProxySettings | ||
{ | ||
public bool UseReverseProxyHeaders { get; private set; } | ||
|
||
public string OverrideForForwardingHostServer { get; private set; } | ||
|
||
public int? OverrideForForwardingHostPort { get; private set; } | ||
|
||
public ReverseProxySettings(bool? useReverseProxyHeaders, string overrideForForwardingHostServer, int? overrideForForwardingHostPort) | ||
{ | ||
this.UseReverseProxyHeaders = useReverseProxyHeaders ?? false; | ||
this.OverrideForForwardingHostPort = overrideForForwardingHostPort; | ||
this.OverrideForForwardingHostServer = overrideForForwardingHostServer; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.