From b4e80abab14a34cc5f9c76c869dee8d4e3c3a312 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sun, 2 Nov 2025 09:07:12 +0100 Subject: [PATCH] Auto-correct S3 hostname This PR updates the S3 backend to automatically remove leading and trailing `/` characters so upgrades are less likely to encounter the error, as the previous version did not fail on such hostnames. The check still captures cases where the user attempts to input a path or URL into the hostname field. --- Duplicati/Library/Backend/S3/S3Backend.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Duplicati/Library/Backend/S3/S3Backend.cs b/Duplicati/Library/Backend/S3/S3Backend.cs index c82051674..030cd422b 100644 --- a/Duplicati/Library/Backend/S3/S3Backend.cs +++ b/Duplicati/Library/Backend/S3/S3Backend.cs @@ -249,6 +249,7 @@ namespace Duplicati.Library.Backend options["s3-ext-forcepathstyle"] = "true"; // Validate that hostname doesn't contain a path + hostname = hostname.Trim('/').Trim('\\'); if (hostname.Contains('/') || hostname.Contains('\\')) throw new UserInformationException(Strings.S3Backend.NoPathAllowedInEndpointError, "S3NoPathInEndpoint");