Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/samples/SampleApp/bin/Debug/net8.0/SampleApp.dll",
"program": "${workspaceFolder}/samples/SampleApp/bin/Debug/net9.0/SampleApp.dll",
"args": [],
"cwd": "${workspaceFolder}/samples/SampleApp",
"stopAtEntry": false,
Expand Down
2 changes: 1 addition & 1 deletion .vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.NetCore.Component.Runtime.8.0",
"Microsoft.NetCore.Component.Runtime.9.0",
"Microsoft.NetCore.Component.SDK",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices"
Expand Down
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<AnalysisMode>All</AnalysisMode>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)justeat-oss.snk</AssemblyOriginatorKeyFile>
<Authors>JUSTEAT_OSS</Authors>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<ChecksumAlgorithm>SHA256</ChecksumAlgorithm>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)HttpClientInterception.ruleset</CodeAnalysisRuleSet>
<Company>Just Eat</Company>
Expand Down Expand Up @@ -40,8 +41,8 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseArtifactsOutput>true</UseArtifactsOutput>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<VersionPrefix>4.3.1</VersionPrefix>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<VersionPrefix>5.0.0</VersionPrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(GITHUB_ACTIONS)' != '' ">
<VersionSuffix Condition=" '$(VersionSuffix)' == '' AND '$(GITHUB_HEAD_REF)' == '' ">beta.$(GITHUB_RUN_NUMBER)</VersionSuffix>
Expand Down
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="MarkdownSnippets.MsBuild" Version="27.0.2" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.4.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.10" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
Expand All @@ -18,7 +18,8 @@
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Text.Json" Version="4.7.2" />
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions HttpClientInterception.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="AD0001" Action="None" />
<Rule Id="CA1303" Action="None" />
<Rule Id="CA1515" Action="None" />
<Rule Id="SA1100" Action="None" />
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1129" Action="None" />
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.403",
"version": "9.0.100",
"allowPrerelease": false,
"rollForward": "latestMajor"
}
Expand Down
3 changes: 2 additions & 1 deletion samples/SampleApp.Tests/SampleApp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<IsTestProject>true</IsTestProject>
<NoWarn>$(NoWarn);CA1056;CA1062;CA1707;CA1711;CA1861;CA2007;SA1600</NoWarn>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Content Include="testsettings.json;xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
Expand All @@ -21,6 +21,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Shouldly" />
<PackageReference Include="System.Text.Encodings.Web" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion samples/SampleApp/SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<PropertyGroup>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<NoWarn>$(NoWarn);CA1062;CA2007;SA1600</NoWarn>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Refit" />
<PackageReference Include="System.Text.Json" OverrideVersion="9.0.0" />
</ItemGroup>
</Project>
31 changes: 31 additions & 0 deletions src/HttpClientInterception/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:JustEat.HttpClientInterception.HttpClientInterceptorOptionsExtensions.RegisterGetFromJson``1(JustEat.HttpClientInterception.HttpClientInterceptorOptions,System.String,``0,System.Text.Json.Serialization.Metadata.JsonTypeInfo{``0},System.Net.HttpStatusCode)</Target>
<Left>lib/net6.0/JustEat.HttpClientInterception.dll</Left>
<Right>lib/netstandard2.0/JustEat.HttpClientInterception.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:JustEat.HttpClientInterception.HttpRequestInterceptionBuilderExtensions.WithJsonContent``1(JustEat.HttpClientInterception.HttpRequestInterceptionBuilder,``0,System.Text.Json.Serialization.Metadata.JsonTypeInfo{``0})</Target>
<Left>lib/net6.0/JustEat.HttpClientInterception.dll</Left>
<Right>lib/netstandard2.0/JustEat.HttpClientInterception.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:JustEat.HttpClientInterception.HttpClientInterceptorOptionsExtensions.RegisterGetFromJson``1(JustEat.HttpClientInterception.HttpClientInterceptorOptions,System.String,``0,System.Text.Json.Serialization.Metadata.JsonTypeInfo{``0},System.Net.HttpStatusCode)</Target>
<Left>lib/net7.0/JustEat.HttpClientInterception.dll</Left>
<Right>lib/netstandard2.0/JustEat.HttpClientInterception.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:JustEat.HttpClientInterception.HttpRequestInterceptionBuilderExtensions.WithJsonContent``1(JustEat.HttpClientInterception.HttpRequestInterceptionBuilder,``0,System.Text.Json.Serialization.Metadata.JsonTypeInfo{``0})</Target>
<Left>lib/net7.0/JustEat.HttpClientInterception.dll</Left>
<Right>lib/netstandard2.0/JustEat.HttpClientInterception.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ public static HttpClientInterceptorOptions RegisterByteArray(
throw new ArgumentNullException(nameof(contentFactory));
}

IDictionary<string, IEnumerable<string>>? multivalueHeaders = null;
Dictionary<string, IEnumerable<string>>? multivalueHeaders = null;

if (responseHeaders is not null)
{
multivalueHeaders = new Dictionary<string, IEnumerable<string>>();
multivalueHeaders = [];

foreach (var pair in responseHeaders)
{
multivalueHeaders[pair.Key] = new[] { pair.Value };
multivalueHeaders[pair.Key] = [pair.Value];
}
}

Expand Down Expand Up @@ -157,15 +157,15 @@ public static HttpClientInterceptorOptions RegisterStream(
throw new ArgumentNullException(nameof(contentStream));
}

IDictionary<string, IEnumerable<string>>? multivalueHeaders = null;
Dictionary<string, IEnumerable<string>>? multivalueHeaders = null;

if (responseHeaders is not null)
{
multivalueHeaders = new Dictionary<string, IEnumerable<string>>();
multivalueHeaders = [];

foreach (var pair in responseHeaders)
{
multivalueHeaders[pair.Key] = new[] { pair.Value };
multivalueHeaders[pair.Key] = [pair.Value];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,32 @@
<Description>A .NET library for intercepting server-side HTTP dependencies.</Description>
<EnablePackageValidation>true</EnablePackageValidation>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CA1510</NoWarn>
<NuGetAuditMode>direct</NuGetAuditMode>
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
<PackageId>JustEat.HttpClientInterception</PackageId>
<PackageValidationBaselineVersion>4.2.0</PackageValidationBaselineVersion>
<!-- TODO Update to 4.4.0 once released -->
<PackageValidationBaselineVersion>4.3.0</PackageValidationBaselineVersion>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<RootNamespace>JustEat.HttpClientInterception</RootNamespace>
<SignAssembly>true</SignAssembly>
<Summary>A .NET library for intercepting server-side HTTP dependencies.</Summary>
<TargetFrameworks>netstandard2.0;net472;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net472;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<PackageVersion Update="System.Text.Json" VersionOverride="6.0.0" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">
<PackageVersion Update="System.Text.Json" VersionOverride="7.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<PackageReference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />
</ItemGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
</Project>
Loading