Dynamically populate LocalAddress based on HTTP request

Support populating the LocalAddress field in the system info
endpoint based on the x-forwarded-host and x-forwarded-proto header.

The x-forwarded-host header must contain both the host and port for
the url to be properly constructed.

Behind network configuration option that is disabled by default.
This commit is contained in:
Fredrik Lindberg
2021-08-31 22:22:55 +02:00
parent e15fea5dad
commit 90174f68e2
5 changed files with 29 additions and 11 deletions

View File

@@ -51,11 +51,11 @@ namespace MediaBrowser.Controller
/// <summary>
/// Gets the system info.
/// </summary>
/// <param name="source">The originator of the request.</param>
/// <param name="request">The HTTP request.</param>
/// <returns>SystemInfo.</returns>
SystemInfo GetSystemInfo(IPAddress source);
SystemInfo GetSystemInfo(HttpRequest request);
PublicSystemInfo GetPublicSystemInfo(IPAddress address);
PublicSystemInfo GetPublicSystemInfo(HttpRequest request);
/// <summary>
/// Gets a URL specific for the request.