Skip to content

Commit 88b8b57

Browse files
committed
EmbedIO 2.2.1
1 parent 5d31be0 commit 88b8b57

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

src/Unosquare.Labs.EmbedIO.Samples/Unosquare.Labs.EmbedIO.Samples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</ItemGroup>
2525

2626
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">
27-
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.11" />
27+
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.12" />
2828
</ItemGroup>
2929

3030
</Project>

src/Unosquare.Labs.EmbedIO/Extensions.Response.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static Task<bool> JsonResponseAsync(
7979
this IHttpContext context,
8080
object data,
8181
CancellationToken cancellationToken = default,
82-
bool useGzip = false)
82+
bool useGzip = true)
8383
=> context.JsonResponseAsync(Json.Serialize(data), cancellationToken, useGzip);
8484

8585
/// <summary>
@@ -104,7 +104,7 @@ public static Task<bool> JsonResponseAsync(
104104
this IHttpContext context,
105105
string json,
106106
CancellationToken cancellationToken = default,
107-
bool useGzip = false)
107+
bool useGzip = true)
108108
=> context.StringResponseAsync(json, cancellationToken: cancellationToken, useGzip: useGzip);
109109

110110
/// <summary>
@@ -121,7 +121,7 @@ public static Task<bool> HtmlResponseAsync(
121121
string htmlContent,
122122
System.Net.HttpStatusCode statusCode = System.Net.HttpStatusCode.OK,
123123
CancellationToken cancellationToken = default,
124-
bool useGzip = false)
124+
bool useGzip = true)
125125
{
126126
context.Response.StatusCode = (int)statusCode;
127127
return context.StringResponseAsync(htmlContent, Responses.HtmlContentType, cancellationToken, useGzip: useGzip);
@@ -156,7 +156,7 @@ public static Task<bool> JsonExceptionResponseAsync(
156156
this IHttpContext context,
157157
Exception ex,
158158
System.Net.HttpStatusCode statusCode = System.Net.HttpStatusCode.InternalServerError,
159-
bool useGzip = false)
159+
bool useGzip = true)
160160
{
161161
context.Response.StatusCode = (int)statusCode;
162162
return context.JsonResponseAsync(ex, useGzip: useGzip);
@@ -180,12 +180,9 @@ public static Task<bool> StringResponseAsync(
180180
string contentType = "application/json",
181181
CancellationToken cancellationToken = default,
182182
Encoding encoding = null,
183-
bool useGzip = false)
183+
bool useGzip = true)
184184
{
185-
var bytes = (encoding ?? Encoding.UTF8).GetBytes(content ?? string.Empty);
186-
187-
using (MemoryStream buffer = new MemoryStream(bytes))
188-
return context.Response.StringResponseAsync(content, contentType, cancellationToken, encoding, useGzip && context.AcceptGzip(bytes.Length));
185+
return context.Response.StringResponseAsync(content, contentType, cancellationToken, encoding, useGzip && context.AcceptGzip(content.Length));
189186
}
190187

191188
/// <summary>
@@ -210,7 +207,7 @@ public static Task<bool> StringResponseAsync(
210207
{
211208
response.ContentType = contentType;
212209

213-
using (MemoryStream buffer = new MemoryStream((encoding ?? Encoding.UTF8).GetBytes(content)))
210+
using (var buffer = new MemoryStream((encoding ?? Encoding.UTF8).GetBytes(content)))
214211
return BinaryResponseAsync(response, buffer, cancellationToken, useGzip);
215212
}
216213

src/Unosquare.Labs.EmbedIO/Unosquare.Labs.EmbedIO.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageId>EmbedIO</PackageId>
1212
<CodeAnalysisRuleSet>..\..\StyleCop.Analyzers.ruleset</CodeAnalysisRuleSet>
1313
<DebugType>Full</DebugType>
14-
<Version>2.2.0</Version>
14+
<Version>2.2.1</Version>
1515
<Product>EmbedIO</Product>
1616
<Company>Unosquare</Company>
1717
<PackageLicenseUrl>https://raw.githubusercontent.com/unosquare/embedio/master/LICENSE</PackageLicenseUrl>

test/Unosquare.Labs.EmbedIO.Tests/Unosquare.Labs.EmbedIO.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta008">
25+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.1-beta.61">
2626
<PrivateAssets>All</PrivateAssets>
2727
</PackageReference>
2828
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />

0 commit comments

Comments
 (0)