mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
Enable compression for http requests (#888)
Enable compression for http requests made by VRCX to improve bandwidth usage and speed. Also removed duplicate setWorldImage assigning.
This commit is contained in:
@@ -182,6 +182,7 @@ namespace VRCX
|
|||||||
if (ProxySet)
|
if (ProxySet)
|
||||||
request.Proxy = Proxy;
|
request.Proxy = Proxy;
|
||||||
|
|
||||||
|
request.AutomaticDecompression = DecompressionMethods.All;
|
||||||
request.Method = "POST";
|
request.Method = "POST";
|
||||||
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
|
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
|
||||||
request.ContentType = "multipart/form-data; boundary=" + boundary;
|
request.ContentType = "multipart/form-data; boundary=" + boundary;
|
||||||
@@ -229,6 +230,7 @@ namespace VRCX
|
|||||||
if (ProxySet)
|
if (ProxySet)
|
||||||
request.Proxy = Proxy;
|
request.Proxy = Proxy;
|
||||||
|
|
||||||
|
request.AutomaticDecompression = DecompressionMethods.All;
|
||||||
request.Method = "PUT";
|
request.Method = "PUT";
|
||||||
request.ContentType = options["fileMIME"] as string;
|
request.ContentType = options["fileMIME"] as string;
|
||||||
var fileData = options["fileData"] as string;
|
var fileData = options["fileData"] as string;
|
||||||
@@ -246,6 +248,7 @@ namespace VRCX
|
|||||||
if (ProxySet)
|
if (ProxySet)
|
||||||
request.Proxy = Proxy;
|
request.Proxy = Proxy;
|
||||||
|
|
||||||
|
request.AutomaticDecompression = DecompressionMethods.All;
|
||||||
request.Method = "POST";
|
request.Method = "POST";
|
||||||
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
|
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
|
||||||
request.ContentType = "multipart/form-data; boundary=" + boundary;
|
request.ContentType = "multipart/form-data; boundary=" + boundary;
|
||||||
@@ -307,6 +310,7 @@ namespace VRCX
|
|||||||
request.CookieContainer = _cookieContainer;
|
request.CookieContainer = _cookieContainer;
|
||||||
request.KeepAlive = true;
|
request.KeepAlive = true;
|
||||||
request.UserAgent = Program.Version;
|
request.UserAgent = Program.Version;
|
||||||
|
request.AutomaticDecompression = DecompressionMethods.All;
|
||||||
|
|
||||||
if (options.TryGetValue("headers", out object headers))
|
if (options.TryGetValue("headers", out object headers))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23522,21 +23522,6 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
API.setWorldImage = function (params) {
|
|
||||||
return this.call(`worlds/${params.id}`, {
|
|
||||||
method: 'PUT',
|
|
||||||
params
|
|
||||||
}).then((json) => {
|
|
||||||
var args = {
|
|
||||||
json,
|
|
||||||
params
|
|
||||||
};
|
|
||||||
this.$emit('WORLDIMAGE:SET', args);
|
|
||||||
this.$emit('WORLD', args);
|
|
||||||
return args;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
API.$on('WORLDIMAGE:SET', function (args) {
|
API.$on('WORLDIMAGE:SET', function (args) {
|
||||||
$app.worldDialog.loading = false;
|
$app.worldDialog.loading = false;
|
||||||
$app.changeWorldImageDialogLoading = false;
|
$app.changeWorldImageDialogLoading = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user