mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Encode URL Path for ACL
This commit is contained in:
parent
7c3569a39d
commit
c215797c8a
1 changed files with 3 additions and 4 deletions
|
@ -29,9 +29,9 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib;
|
||||
using ShareX.UploadersLib.Properties;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX.UploadersLib.FileUploaders
|
||||
|
@ -141,12 +141,11 @@ public override UploadResult Upload(Stream stream, string fileName)
|
|||
stream, contentType, args, googleAuth.GetAuthHeaders());
|
||||
string responsename = JsonConvert.DeserializeObject<GoogleCloudStorageResponse>(result.Response).name;
|
||||
|
||||
Debug.WriteLine(uploadpath);
|
||||
|
||||
if (responsename == uploadpath)
|
||||
{
|
||||
string encodeduploadpath = HttpUtility.UrlEncode(uploadpath);
|
||||
string requestjson = JsonConvert.SerializeObject(publicacl);
|
||||
SendRequest(HttpMethod.POST, $"https://www.googleapis.com/storage/v1/b/{bucket}/o/{uploadpath}/acl",
|
||||
SendRequest(HttpMethod.POST, $"https://www.googleapis.com/storage/v1/b/{bucket}/o/{encodeduploadpath}/acl",
|
||||
requestjson, ContentTypeJSON, headers: googleAuth.GetAuthHeaders());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue