Skip to content

Commit

Permalink
😊 发布 v1.0.6.1 版本,改进 RateLimitedStream 带应用速率限制的流
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkSoul committed Dec 3, 2024
1 parent b95c995 commit 07ea87e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageOutputPath>$(SolutionDir)nupkgs</PackageOutputPath>
<Version>1.0.6</Version>
<Version>1.0.6.1</Version>
<PackageVersion>$(Version)</PackageVersion>
<Authors>百小僧</Authors>
<Description>HttpAgent 是一个高性能、灵活且易用的开源库,提供了全面的 HTTP 功能支持,包括文件传输、轮询、测试工具、实时通信、请求管理、Media 类型处理、MessagePack 支持等,并具有低资源消耗和高测试覆盖率的特点。</Description>
Expand Down
14 changes: 7 additions & 7 deletions src/HttpAgent/test/HttpRemoteServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void CreateHttpClientWithDefaults_ReturnOK()

Assert.NotNull(httpClient);
Assert.Null(httpClientPooling.Release);
Assert.Equal("HttpAgent/1.0.6.0", httpClient.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.Equal("HttpAgent/1.0.6.1", httpClient.DefaultRequestHeaders.GetValues("User-Agent").First());

var httpRequestBuilder2 =
new HttpRequestBuilder(HttpMethod.Get, new Uri("/api/test", UriKind.RelativeOrAbsolute))
Expand All @@ -99,7 +99,7 @@ public void CreateHttpClientWithDefaults_ReturnOK()
Assert.NotNull(httpClient2.BaseAddress);
Assert.Equal("http://localhost/test/", httpClient2.BaseAddress.ToString());
Assert.Null(httpClientPooling2.Release);
Assert.Equal("HttpAgent/1.0.6.0", httpClient2.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.Equal("HttpAgent/1.0.6.1", httpClient2.DefaultRequestHeaders.GetValues("User-Agent").First());

var httpClient3 = new HttpClient { BaseAddress = new Uri("http://localhost/custom") };
var httpRequestBuilder3 =
Expand All @@ -112,7 +112,7 @@ public void CreateHttpClientWithDefaults_ReturnOK()
var httpClientPooling3 = httpRemoteService.CreateHttpClientWithDefaults(httpRequestBuilder3);
var httpClient4 = httpClientPooling3.Instance;
Assert.Equal(httpClient3, httpClient4);
Assert.Equal("HttpAgent/1.0.6.0", httpClient4.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.Equal("HttpAgent/1.0.6.1", httpClient4.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.NotNull(httpClientPooling3.Release);
httpClientPooling3.Release(httpClient3);

Expand Down Expand Up @@ -153,7 +153,7 @@ public void CreateHttpClientPooling_ReturnOK()

Assert.NotNull(httpClient);
Assert.Null(httpClientPooling.Release);
Assert.Equal("HttpAgent/1.0.6.0", httpClient.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.Equal("HttpAgent/1.0.6.1", httpClient.DefaultRequestHeaders.GetValues("User-Agent").First());

var httpRequestBuilder2 =
new HttpRequestBuilder(HttpMethod.Get, new Uri("/api/test", UriKind.RelativeOrAbsolute))
Expand All @@ -164,7 +164,7 @@ public void CreateHttpClientPooling_ReturnOK()
Assert.NotNull(httpClient2.BaseAddress);
Assert.Equal("http://localhost/test/", httpClient2.BaseAddress.ToString());
Assert.Null(httpClientPooling2.Release);
Assert.Equal("HttpAgent/1.0.6.0", httpClient2.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.Equal("HttpAgent/1.0.6.1", httpClient2.DefaultRequestHeaders.GetValues("User-Agent").First());

var httpClient3 = new HttpClient { BaseAddress = new Uri("http://localhost/custom") };
var httpRequestBuilder3 =
Expand All @@ -177,7 +177,7 @@ public void CreateHttpClientPooling_ReturnOK()
var httpClientPooling3 = httpRemoteService.CreateHttpClientPooling(httpRequestBuilder3);
var httpClient4 = httpClientPooling3.Instance;
Assert.Equal(httpClient3, httpClient4);
Assert.Equal("HttpAgent/1.0.6.0", httpClient4.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.Equal("HttpAgent/1.0.6.1", httpClient4.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.NotNull(httpClientPooling3.Release);
httpClientPooling3.Release(httpClient3);

Expand All @@ -190,7 +190,7 @@ public void AddDefaultUserAgentHeader_ReturnOK()
var httpClient = new HttpClient();
HttpRemoteService.AddDefaultUserAgentHeader(httpClient);

Assert.Equal("HttpAgent/1.0.6.0", httpClient.DefaultRequestHeaders.GetValues("User-Agent").First());
Assert.Equal("HttpAgent/1.0.6.1", httpClient.DefaultRequestHeaders.GetValues("User-Agent").First());

var httpClient2 = new HttpClient();
httpClient2.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "furion");
Expand Down

0 comments on commit 07ea87e

Please sign in to comment.