Skip to content

Commit

Permalink
🔖 1.23.10614.11129
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Jun 14, 2023
1 parent 4820a51 commit da1410e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
needs: [ test ]
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
runs-on: windows-latest
continue-on-error: true
strategy:
matrix:
ProjectName: [
Expand Down Expand Up @@ -159,8 +160,8 @@ jobs:
shell: pwsh
run: |
dotnet nuget push pkg\${{ matrix.ProjectName }}*.nupkg -s https://nuget.pkg.github.com/BeyondDimension -k ${{ secrets.RMBADMIN_TOKEN }} --skip-duplicate
dotnet nuget push pkg\${{ matrix.ProjectName }}*.snupkg -s https://nuget.pkg.github.com/BeyondDimension -k ${{ secrets.RMBADMIN_TOKEN }} --skip-duplicate
dotnet nuget push pkg\${{ matrix.ProjectName }}*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
dotnet nuget push pkg\${{ matrix.ProjectName }}*.snupkg -s https://nuget.pkg.github.com/BeyondDimension -k ${{ secrets.RMBADMIN_TOKEN }} --skip-duplicate
dotnet nuget push pkg\${{ matrix.ProjectName }}*.snupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
release:
name: Release
Expand Down
2 changes: 1 addition & 1 deletion ref/DirectoryPackages
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
</PropertyGroup>

<ItemGroup>
<!--<Compile Remove="OutputPath\**" />-->
<Compile Remove="OutputPath\**" />
<EmbeddedResource Remove="OutputPath\**" />
<None Remove="OutputPath\**" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/BD.Common/Net/Http/HttpClientServiceBaseImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public HttpClientUseCookiesServiceBaseImpl()
_client = GetLazyHttpClient();
}

public HttpClientUseCookiesServiceBaseImpl(Func<CookieContainer, HttpHandlerType> func)
{
Handler = func(cookieContainer);
_client = GetLazyHttpClient();
}

static HttpHandlerType CreateHandler(CookieContainer cookieContainer)
{
var handler = new HttpHandlerType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public HttpClientUseCookiesWithProxyServiceImpl(Func<HttpHandlerType, HttpClient
this.logger = logger;
}

public HttpClientUseCookiesWithProxyServiceImpl(Func<CookieContainer, HttpHandlerType> func, ILogger logger) : base(func)
{
this.logger = logger;
}

protected override HttpClient GetHttpClient()
=> func == null ? base.GetHttpClient() : func(Handler);

Expand Down Expand Up @@ -97,12 +102,14 @@ public abstract class HttpClientUseCookiesWithDynamicProxyServiceImpl : HttpClie
{
readonly DynamicWebProxy? proxy;
readonly IDisposable? options_disposable;
readonly bool useProxy;

public HttpClientUseCookiesWithDynamicProxyServiceImpl(IServiceProvider? s, ILogger logger) : base(null, logger)
public HttpClientUseCookiesWithDynamicProxyServiceImpl(IServiceProvider? s, ILogger logger) : base((Func<HttpHandlerType, HttpClient>?)null, logger)
{
if (s == null) return;
var o = s.GetService<IOptionsMonitor<IAppSettings>>();
var options = o == null ? default : o.CurrentValue;
useProxy = true;
proxy = new DynamicWebProxy()
{
InnerProxy = GetWebProxy(options),
Expand All @@ -115,14 +122,21 @@ public HttpClientUseCookiesWithDynamicProxyServiceImpl(IServiceProvider? s, ILog
});
}

public HttpClientUseCookiesWithDynamicProxyServiceImpl(Func<CookieContainer, HttpHandlerType> func, ILogger logger) : base(func, logger)
{

}

void SetHandler()
{
if (!useProxy) return;
Handler.UseProxy = true;
Handler.Proxy = proxy;
}

public override void Reset()
{
if (!useProxy) return;
base.Reset();
SetHandler();
}
Expand Down
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 @@
<ImplicitUsings>enable</ImplicitUsings>
<IsTrimmable>true</IsTrimmable>
<!--<Version>1.yy.1MMdd.1hhmm</Version>-->
<Version>1.23.10613.11501</Version>
<Version>1.23.10614.11129</Version>
<PackageIconUrl>https://avatars.githubusercontent.com/u/79355691?s=200&amp;v=4</PackageIconUrl>
<Company>长沙次元超越科技有限公司</Company>
<Copyright>©️ $(Company). All rights reserved.</Copyright>
Expand Down

0 comments on commit da1410e

Please sign in to comment.