Added .Net framework 4.8 and upgraded to .NET 8.0
This commit is contained in:
@@ -41,12 +41,12 @@ namespace EonaCat.Logger.Test.Web
|
||||
|
||||
var oFS = new OffsetStream(fS, 0, limit);
|
||||
var request = context.Request;
|
||||
Stream s;
|
||||
Stream stream;
|
||||
|
||||
string acceptEncoding = request.Headers["Accept-Encoding"];
|
||||
if (string.IsNullOrEmpty(acceptEncoding))
|
||||
{
|
||||
s = response.Body;
|
||||
stream = response.Body;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -55,36 +55,33 @@ namespace EonaCat.Logger.Test.Web
|
||||
if (acceptEncodingParts.Contains("br"))
|
||||
{
|
||||
response.Headers.ContentEncoding = "br";
|
||||
s = new BrotliStream(response.Body, CompressionMode.Compress);
|
||||
stream = new BrotliStream(response.Body, CompressionMode.Compress);
|
||||
}
|
||||
else if (acceptEncodingParts.Contains("gzip"))
|
||||
{
|
||||
response.Headers.ContentEncoding = "gzip";
|
||||
s = new GZipStream(response.Body, CompressionMode.Compress);
|
||||
stream = new GZipStream(response.Body, CompressionMode.Compress);
|
||||
}
|
||||
else if (acceptEncodingParts.Contains("deflate"))
|
||||
{
|
||||
response.Headers.ContentEncoding = "deflate";
|
||||
s = new DeflateStream(response.Body, CompressionMode.Compress);
|
||||
stream = new DeflateStream(response.Body, CompressionMode.Compress);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = response.Body;
|
||||
stream = response.Body;
|
||||
}
|
||||
}
|
||||
|
||||
await using (s)
|
||||
await using (stream)
|
||||
{
|
||||
await oFS.CopyToAsync(s).ConfigureAwait(false);
|
||||
await oFS.CopyToAsync(stream).ConfigureAwait(false);
|
||||
|
||||
if (fS.Length > limit)
|
||||
await s.WriteAsync("\r\n####__EONACATLOGGER_TRUNCATED___####"u8.ToArray()).ConfigureAwait(false);
|
||||
await stream.WriteAsync("\r\n####__EONACATLOGGER_TRUNCATED___####"u8.ToArray()).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void Log(string message, ELogType logType = ELogType.INFO, bool writeToConsole = true)
|
||||
{
|
||||
if (IsDisabled)
|
||||
|
||||
Reference in New Issue
Block a user