diff --git a/CHANGELOG.md b/CHANGELOG.md index 227b60e3..5201b2c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [2.9.1] - 2021-10-11 +### Added +* *Nothing* + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* [#1201](https://github.com/shlinkio/shlink/issues/1201) Fixed crash when using the new `USE_HTTPS`, as it's boolean raw value was being used instead of resolving "https" or "http". + + ## [2.9.0] - 2021-10-10 ### Added * [#1015](https://github.com/shlinkio/shlink/issues/1015) Shlink now accepts configuration via env vars even when not using docker. diff --git a/config/autoload/url-shortener.global.php b/config/autoload/url-shortener.global.php index ae6bfe84..aedab669 100644 --- a/config/autoload/url-shortener.global.php +++ b/config/autoload/url-shortener.global.php @@ -10,14 +10,22 @@ use const Shlinkio\Shlink\MIN_SHORT_CODES_LENGTH; return (static function (): array { $shortCodesLength = (int) env('DEFAULT_SHORT_CODES_LENGTH', DEFAULT_SHORT_CODES_LENGTH); $shortCodesLength = $shortCodesLength < MIN_SHORT_CODES_LENGTH ? MIN_SHORT_CODES_LENGTH : $shortCodesLength; - $useHttps = env('USE_HTTPS'); // Deprecated. For v3, set this to true by default, instead of null + $resolveSchema = static function (): string { + $useHttps = env('USE_HTTPS'); // Deprecated. For v3, set this to true by default, instead of null + if ($useHttps !== null) { + $boolUseHttps = (bool) $useHttps; + return $boolUseHttps ? 'https' : 'http'; + } + + return env('SHORT_DOMAIN_SCHEMA', 'http'); + }; return [ 'url_shortener' => [ 'domain' => [ // Deprecated SHORT_DOMAIN_* env vars - 'schema' => $useHttps !== null ? (bool) $useHttps : env('SHORT_DOMAIN_SCHEMA', 'http'), + 'schema' => $resolveSchema(), 'hostname' => env('DEFAULT_DOMAIN', env('SHORT_DOMAIN_HOST', '')), ], 'validate_url' => (bool) env('VALIDATE_URLS', false), // Deprecated