$env->{SCRIPT_URI}, which is not standardized in PSGI Environment but is long available in Apache CGI, is a handy way to refer to the absolute URI of the current page. But unfortunately, it usually returns "http:" URI when the app is placed behind a Load Balancer.
So, let's change &yatt:script_uri; to replace URI scheme with HTTP_X_FORWARDED_PROTO if it is available.
$env->{SCRIPT_URI}
, which is not standardized in PSGI Environment but is long available in Apache CGI, is a handy way to refer to the absolute URI of the current page. But unfortunately, it usually returns "http:" URI when the app is placed behind a Load Balancer.So, let's change
&yatt:script_uri;
to replace URI scheme with HTTP_X_FORWARDED_PROTO if it is available.