mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Fix B2 custom URL
This commit is contained in:
parent
a30f565b94
commit
5aadccc0ca
3 changed files with 4 additions and 6 deletions
|
@ -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}");
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue