Fix B2 custom URL

This commit is contained in:
Jaex 2022-05-23 13:03:17 +03:00
parent a30f565b94
commit 5aadccc0ca
3 changed files with 4 additions and 6 deletions

View file

@ -235,8 +235,7 @@ public override UploadResult Upload(Stream stream, string fileName)
if (UseCustomUrl)
{
string parsedCustomUrl = NameParser.Parse(NameParserType.FilePath, CustomUrl);
remoteLocation = URLHelpers.CombineURL(parsedCustomUrl, encodedFileName);
remoteLocation = URLHelpers.CombineURL(CustomUrl, encodedFileName);
remoteLocation = URLHelpers.FixPrefix(remoteLocation, "https://");
DebugHelper.WriteLine($"B2 uploader: But user requested custom URL, which will be: {remoteLocation}");

View file

@ -259,14 +259,14 @@ public string GetUriPath(string fileName, string subFolderPath = null)
return httpHomeUri.Uri.OriginalString;
}
public string GetFtpPath(string filemame)
public string GetFtpPath(string fileName)
{
if (string.IsNullOrEmpty(FTPAddress))
{
return "";
}
return URLHelpers.CombineURL(FTPAddress, GetSubFolderPath(filemame, NameParserType.FilePath));
return URLHelpers.CombineURL(FTPAddress, GetSubFolderPath(fileName, NameParserType.FilePath));
}
public override string ToString()

View file

@ -298,8 +298,7 @@ private void B2UpdateCustomDomainPreview()
if (cbB2CustomUrl.Checked)
{
string customUrl = NameParser.Parse(NameParserType.FilePath, Config.B2CustomUrl);
url = URLHelpers.CombineURL(customUrl, uploadPath, "example.png");
url = URLHelpers.CombineURL(Config.B2CustomUrl, uploadPath, "example.png");
url = URLHelpers.FixPrefix(url, "https://");
}
else