From a09ff1f3e254c564ae001d2a20243a499737cde0 Mon Sep 17 00:00:00 2001 From: Jose Quintana <1700322+joseluisq@users.noreply.github.com> Date: Thu, 17 Nov 2022 16:35:47 +0100 Subject: [PATCH] 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. --- 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(-) diff --git a/docs/content/configuration/command-line-arguments.md b/docs/content/configuration/command-line-arguments.md index e664248..ede2217 100644 --- a/docs/content/configuration/command-line-arguments.md +++ b/docs/content/configuration/command-line-arguments.md @@ -101,7 +101,7 @@ OPTIONS: -p, --port Host port [env: SERVER_PORT=] [default: 80] --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 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 diff --git a/docs/content/configuration/environment-variables.md b/docs/content/configuration/environment-variables.md index 3cf3741..9fd09ec 100644 --- a/docs/content/configuration/environment-variables.md +++ b/docs/content/configuration/environment-variables.md @@ -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 diff --git a/src/settings/cli.rs b/src/settings/cli.rs index 5c9ae26..54802eb 100644 --- a/src/settings/cli.rs +++ b/src/settings/cli.rs @@ -214,7 +214,7 @@ pub struct General { long, parse(try_from_str), default_value = "true", - env = "REDIRECT_TRAILING_SLASH" + env = "SERVER_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. pub redirect_trailing_slash: bool, -- libgit2 1.7.2