mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-02 21:20:28 +12:00
Fix B2 custom URL
This commit is contained in:
parent
a30f565b94
commit
5aadccc0ca
|
@ -235,8 +235,7 @@ public override UploadResult Upload(Stream stream, string fileName)
|
||||||
|
|
||||||
if (UseCustomUrl)
|
if (UseCustomUrl)
|
||||||
{
|
{
|
||||||
string parsedCustomUrl = NameParser.Parse(NameParserType.FilePath, CustomUrl);
|
remoteLocation = URLHelpers.CombineURL(CustomUrl, encodedFileName);
|
||||||
remoteLocation = URLHelpers.CombineURL(parsedCustomUrl, encodedFileName);
|
|
||||||
remoteLocation = URLHelpers.FixPrefix(remoteLocation, "https://");
|
remoteLocation = URLHelpers.FixPrefix(remoteLocation, "https://");
|
||||||
|
|
||||||
DebugHelper.WriteLine($"B2 uploader: But user requested custom URL, which will be: {remoteLocation}");
|
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;
|
return httpHomeUri.Uri.OriginalString;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetFtpPath(string filemame)
|
public string GetFtpPath(string fileName)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(FTPAddress))
|
if (string.IsNullOrEmpty(FTPAddress))
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return URLHelpers.CombineURL(FTPAddress, GetSubFolderPath(filemame, NameParserType.FilePath));
|
return URLHelpers.CombineURL(FTPAddress, GetSubFolderPath(fileName, NameParserType.FilePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
|
|
@ -298,8 +298,7 @@ private void B2UpdateCustomDomainPreview()
|
||||||
|
|
||||||
if (cbB2CustomUrl.Checked)
|
if (cbB2CustomUrl.Checked)
|
||||||
{
|
{
|
||||||
string customUrl = NameParser.Parse(NameParserType.FilePath, Config.B2CustomUrl);
|
url = URLHelpers.CombineURL(Config.B2CustomUrl, uploadPath, "example.png");
|
||||||
url = URLHelpers.CombineURL(customUrl, uploadPath, "example.png");
|
|
||||||
url = URLHelpers.FixPrefix(url, "https://");
|
url = URLHelpers.FixPrefix(url, "https://");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue