Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhantolga committed Apr 4, 2024
1 parent 367d2a1 commit 4f2fc6b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ jobs:
PROJECT_FILE_PATH: LaserCatEyes.WCFListener/LaserCatEyes.WCFListener.csproj
NUGET_KEY: ${{secrets.NUGET_KEY}}

- name: publish LaserCatEyes.FunctionEndpointListener
id: publish_nuget_LaserCatEyes_FunctionEndpointListener
uses: alirezanet/[email protected]
with:
PROJECT_FILE_PATH: LaserCatEyes.FunctionEndpointListener/LaserCatEyes.FunctionEndpointListener.csproj
NUGET_KEY: ${{secrets.NUGET_KEY}}

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net8.0;net7.0;net6.0;</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Copyright>Betalgo Up Ltd.</Copyright>
<Copyright>Betalgo Up Ltd.</Copyright>
<LangVersion>Latest</LangVersion>
<PackageProjectUrl>https://portal.lasercateyes.com</PackageProjectUrl>
<PackageIcon>LaserCatEyes_Logo.png</PackageIcon>
Expand All @@ -13,7 +13,7 @@
<Authors>Betalgo Up Ltd.</Authors>
<Company>Betalgo Up Ltd.</Company>
<Product>Laser Cat Eyes</Product>
<Description>
<Description>
lasercateyes.com
Laser Cat Eyes is an online debugging tool that can capture, inspect, monitor all HTTP/HTTPS traffic from your application. It contains a network function like diagnose network issues, etc.

Expand All @@ -33,12 +33,10 @@
<ItemGroup>
<ProjectReference Include="..\LaserCatEyes.DataServiceSdk\LaserCatEyes.DataServiceSdk.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="LaserCatEyes_Logo.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LaserCatEyes_Logo.png" Pack="true" PackagePath="" />
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
using System;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using LaserCatEyes.DataServiceSdk;
using LaserCatEyes.Domain;
using LaserCatEyes.Domain.Models;
using LaserCatEyes.HttpClientListener;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
Expand Down Expand Up @@ -57,5 +62,23 @@ private static IServiceCollection AddLaserCatEyesHttpClientListenerBase(IService

return services;
}

public static IHttpClientBuilder AddLaserCatEyesHttpClientListener(this IHttpClientBuilder builder)
{
var services = builder.Services;

if (services.All(x => x.ServiceType != typeof(ILaserCatEyesDataService)))
{
services.AddLaserCatEyesHttpClientListener(false);
}

builder.AddHttpMessageHandler(serviceProvider =>
{
var handler = serviceProvider.GetRequiredService<LaserCatEyesHttpMessageHandler>();
return handler;
});

return builder;
}
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ or
services.AddHttpClient("myClient", c =>
{
//your settings
}).AddHttpMessageHandler<LaserCatEyesHttpMessageHandler>();
}).AddLaserCatEyesHttpClientListener();
}
}
```
Expand Down

0 comments on commit 4f2fc6b

Please sign in to comment.