EPi.Extensions icon indicating copy to clipboard operation
EPi.Extensions copied to clipboard

`GetFriendlyUrl` ignores site settings when generating absolute URL

Open kaspars-ozols opened this issue 5 years ago • 0 comments

When calling contentReference.GetFriendlyUrl(includeHost: true), returned URL has schema based on incoming request, but not based on schema defined in site settings.

https://github.com/Geta/EPi.Extensions/blob/master/src/Geta.EPi.Extensions/Helpers/UriHelpers.cs#L29

This creates problems in following scenarios: a) site is served through both HTTP & HTTPS, absolute URL should be consistant (for instance, when generating canonical URL) b) load balanced scenario, when HTTPS is offloaded to load balancer, but it does not add X-Forwarded-Proto header

Schema from site settings should be respected, if it is defined. image

kaspars-ozols avatar Mar 01 '19 08:03 kaspars-ozols