diff --git a/DysonNetwork.Drive/Storage/FileController.cs b/DysonNetwork.Drive/Storage/FileController.cs index 006b6bd..747fd4b 100644 --- a/DysonNetwork.Drive/Storage/FileController.cs +++ b/DysonNetwork.Drive/Storage/FileController.cs @@ -145,9 +145,7 @@ public class FileController( private ActionResult? TryProxyRedirect(SnCloudFile file, RemoteStorageConfig dest, string fileName) { if (dest.ImageProxy is not null && (file.MimeType?.StartsWith("image/") ?? false)) - { return Redirect(BuildProxyUrl(dest.ImageProxy, fileName)); - } return dest.AccessProxy is not null ? Redirect(BuildProxyUrl(dest.AccessProxy, fileName)) : null; } @@ -182,6 +180,9 @@ public class FileController( .WithHeaders(headers) ); + if (dest.AccessEndpoint is not null) + openUrl = openUrl.Replace($"{dest.Endpoint}/{dest.Bucket}", dest.AccessEndpoint); + return Redirect(openUrl); } diff --git a/DysonNetwork.Shared/Models/FilePool.cs b/DysonNetwork.Shared/Models/FilePool.cs index 1e16146..ece08d6 100644 --- a/DysonNetwork.Shared/Models/FilePool.cs +++ b/DysonNetwork.Shared/Models/FilePool.cs @@ -9,6 +9,7 @@ public class RemoteStorageConfig public string Region { get; set; } = string.Empty; public string Bucket { get; set; } = string.Empty; public string Endpoint { get; set; } = string.Empty; + public string? AccessEndpoint { get; set; } public string SecretId { get; set; } = string.Empty; public string SecretKey { get; set; } = string.Empty; public bool EnableSigned { get; set; }