mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 13:56:07 +02:00
Small fixes and changes
This commit is contained in:
@@ -174,6 +174,20 @@ namespace VRCX
|
||||
await requestStream.WriteAsync(endBytes, 0, endBytes.Length);
|
||||
requestStream.Close();
|
||||
}
|
||||
|
||||
private static async Task UploadFilePut(HttpWebRequest request, IDictionary<string, object> options)
|
||||
{
|
||||
request.Method = "PUT";
|
||||
request.ContentType = options["fileMIME"] as string;
|
||||
var fileData = options["fileData"] as string;
|
||||
var sentData = Convert.FromBase64CharArray(fileData.ToCharArray(), 0, fileData.Length);
|
||||
request.ContentLength = sentData.Length;
|
||||
using (var sendStream = request.GetRequestStream())
|
||||
{
|
||||
await sendStream.WriteAsync(sentData, 0, sentData.Length);
|
||||
sendStream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task ImageUpload(HttpWebRequest request, IDictionary<string, object> options)
|
||||
{
|
||||
@@ -275,6 +289,11 @@ namespace VRCX
|
||||
{
|
||||
await ImageUpload(request, options);
|
||||
}
|
||||
|
||||
if (options.TryGetValue("uploadFilePUT", out _))
|
||||
{
|
||||
await UploadFilePut(request, options);
|
||||
}
|
||||
|
||||
if (options.TryGetValue("uploadImageLegacy", out _))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user