Compare commits
2 Commits
5ac8041f19
...
6e048b0987
Author | SHA1 | Date |
---|---|---|
Anna | 6e048b0987 | |
Anna | 12f564cc6d |
|
@ -12,7 +12,7 @@ using MessagePack;
|
|||
|
||||
namespace MegaMappingway;
|
||||
|
||||
public class Plugin : IDalamudPlugin {
|
||||
public sealed class Plugin : IDalamudPlugin {
|
||||
[PluginService]
|
||||
internal static IPluginLog Log { get; private set; }
|
||||
|
||||
|
@ -49,6 +49,7 @@ public class Plugin : IDalamudPlugin {
|
|||
this.Ui.Dispose();
|
||||
this.Framework.Update -= this.FrameworkUpdate;
|
||||
this.Hasher.Dispose();
|
||||
this.Http.Dispose();
|
||||
}
|
||||
|
||||
internal void SaveConfig() {
|
||||
|
@ -112,13 +113,26 @@ public class Plugin : IDalamudPlugin {
|
|||
await gz.FlushAsync();
|
||||
}
|
||||
|
||||
var req = new HttpRequestMessage(HttpMethod.Post, "https://map.anna.lgbt/api/upload") {
|
||||
Content = new ByteArrayContent(mem.ToArray()) {
|
||||
var gzipped = mem.ToArray();
|
||||
|
||||
ByteArrayContent content;
|
||||
if (gzipped.Length < msgpack.Length) {
|
||||
content = new ByteArrayContent(gzipped) {
|
||||
Headers = {
|
||||
ContentType = new MediaTypeHeaderValue("application/msgpack"),
|
||||
ContentEncoding = { "gzip" },
|
||||
},
|
||||
},
|
||||
};
|
||||
} else {
|
||||
content = new ByteArrayContent(msgpack) {
|
||||
Headers = {
|
||||
ContentType = new MediaTypeHeaderValue("application/msgpack"),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
var req = new HttpRequestMessage(HttpMethod.Post, "https://map.anna.lgbt/api/upload") {
|
||||
Content = content,
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue