fix: missing `SERVER` prefix for `redirect-trailing-slash` feature (#161)
BREAKING:
this fix is a breaking change only if the previous
`REDIRECT_TRAILING_SLASH` env was used explicitly.
Otherwise, if not set/used (default behavior) then there is no impact.
ADVICE:
we highly encourage users to update `REDIRECT_TRAILING_SLASH` with
`SERVER_REDIRECT_TRAILING_SLASH` for consistency reasons.
Diff
docs/content/configuration/command-line-arguments.md | 4 ++--
docs/content/configuration/environment-variables.md | 2 +-
src/settings/cli.rs | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
@@ -101,7 +101,7 @@ OPTIONS:
-p, --port <port> Host port [env: SERVER_PORT=] [default: 80]
--redirect-trailing-slash <redirect-trailing-slash>
Check for a trailing slash in the requested directory URI and redirect permanently (308) to the same path
with a trailing slash suffix if it is missing [env: REDIRECT_TRAILING_SLASH=] [default: true]
with a trailing slash suffix if it is missing [env: SERVER_REDIRECT_TRAILING_SLASH=] [default: true]
-d, --root <root>
Root directory path of static files [env: SERVER_ROOT=] [default: ./public]
@@ -120,7 +120,7 @@ OPTIONS:
## Windows
Following options and commands are Windows platform specific.
The following options and commands are Windows platform specific.
```
-s, --windows-service <windows-service>
@@ -84,7 +84,7 @@ Enable cache control headers for incoming requests based on a set of file types.
### SERVER_BASIC_AUTH
It provides [The "Basic" HTTP Authentication Scheme](https://datatracker.ietf.org/doc/html/rfc7617) using credentials as `user-id:password` pairs, encoded using `Base64`. Password must be encoded using the [BCrypt](https://en.wikipedia.org/wiki/Bcrypt) password-hashing function. Default empty (disabled).
### REDIRECT_TRAILING_SLASH
### SERVER_REDIRECT_TRAILING_SLASH
Check for a trailing slash in the requested directory URI and redirect permanent (308) to the same path with a trailing slash suffix if it is missing. Default `true` (enabled).
## Windows
@@ -214,7 +214,7 @@ pub struct General {
long,
parse(try_from_str),
default_value = "true",
env = "REDIRECT_TRAILING_SLASH"
env = "SERVER_REDIRECT_TRAILING_SLASH"
)]
pub redirect_trailing_slash: bool,