✨ Support access with custom endpoint
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user