mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
Fix new IPC ObjectDisposedException
This commit is contained in:
@@ -436,8 +436,8 @@ namespace ArchiSteamFarm {
|
|||||||
|
|
||||||
response.ContentLength64 = content.Length;
|
response.ContentLength64 = content.Length;
|
||||||
await response.OutputStream.WriteAsync(content, 0, content.Length).ConfigureAwait(false);
|
await response.OutputStream.WriteAsync(content, 0, content.Length).ConfigureAwait(false);
|
||||||
} catch (Exception e) {
|
} catch (ObjectDisposedException) {
|
||||||
ASF.ArchiLogger.LogGenericDebuggingException(e);
|
// Ignored, request is no longer valid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -475,14 +475,18 @@ namespace ArchiSteamFarm {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.ContentEncoding == null) {
|
try {
|
||||||
response.ContentEncoding = Encoding.UTF8;
|
if (response.ContentEncoding == null) {
|
||||||
|
response.ContentEncoding = Encoding.UTF8;
|
||||||
|
}
|
||||||
|
|
||||||
|
response.ContentType = textType + "; charset=" + response.ContentEncoding.WebName;
|
||||||
|
|
||||||
|
byte[] content = response.ContentEncoding.GetBytes(text + Environment.NewLine);
|
||||||
|
await ResponseBase(request, response, content, statusCode).ConfigureAwait(false);
|
||||||
|
} catch (ObjectDisposedException) {
|
||||||
|
// Ignored, request is no longer valid
|
||||||
}
|
}
|
||||||
|
|
||||||
response.ContentType = textType + "; charset=" + response.ContentEncoding.WebName;
|
|
||||||
|
|
||||||
byte[] content = response.ContentEncoding.GetBytes(text + Environment.NewLine);
|
|
||||||
await ResponseBase(request, response, content, statusCode).ConfigureAwait(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task ResponseText(HttpListenerRequest request, HttpListenerResponse response, string text, HttpStatusCode statusCode = HttpStatusCode.OK) {
|
private static async Task ResponseText(HttpListenerRequest request, HttpListenerResponse response, string text, HttpStatusCode statusCode = HttpStatusCode.OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user