Browse Source

Update the sponsors section

pull/1528/head
OpenIddict Bot 3 years ago
parent
commit
2ee17060cb
  1. 2
      src/OpenIddict.Abstractions/Primitives/OpenIddictExtensions.cs
  2. 9
      src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs
  3. 9
      src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.cs
  4. 5
      test/OpenIddict.Abstractions.Tests/Primitives/OpenIddictExtensionsTests.cs

2
src/OpenIddict.Abstractions/Primitives/OpenIddictExtensions.cs

@ -1277,7 +1277,7 @@ public static class OpenIddictExtensions
foreach (var element in value.EnumerateArray())
{
var item = element.GetString()!;
var item = element.ToString();
if (set.Add(item))
{
identity.AddClaim(new Claim(

9
src/OpenIddict.Client.SystemNetHttp/OpenIddictClientSystemNetHttpHandlers.cs

@ -347,10 +347,6 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
try
{
// Note: HttpCompletionOption.ResponseContentRead is deliberately used to force the
// response stream to be buffered so that can it can be read multiple times if needed
// (e.g if the JSON deserialization process fails, the stream is read as a string
// during a second pass a second time for logging/debuggability purposes).
response = await client.SendAsync(request, HttpCompletionOption.ResponseContentRead);
}
@ -528,12 +524,7 @@ public static partial class OpenIddictClientSystemNetHttpHandlers
// to the HTTP response message to use the specified stream transformations.
if (stream is not null)
{
// Note: StreamContent.LoadIntoBufferAsync is deliberately used to force the stream
// content to be buffered so that can it can be read multiple times if needed
// (e.g if the JSON deserialization process fails, the stream is read as a string
// during a second pass a second time for logging/debuggability purposes).
var content = new StreamContent(stream);
await content.LoadIntoBufferAsync();
// Copy the headers from the original content to the new instance.
foreach (var header in response.Content.Headers)

9
src/OpenIddict.Validation.SystemNetHttp/OpenIddictValidationSystemNetHttpHandlers.cs

@ -348,10 +348,6 @@ public static partial class OpenIddictValidationSystemNetHttpHandlers
try
{
// Note: HttpCompletionOption.ResponseContentRead is deliberately used to force the
// response stream to be buffered so that can it can be read multiple times if needed
// (e.g if the JSON deserialization process fails, the stream is read as a string
// during a second pass a second time for logging/debuggability purposes).
response = await client.SendAsync(request, HttpCompletionOption.ResponseContentRead);
}
@ -529,12 +525,7 @@ public static partial class OpenIddictValidationSystemNetHttpHandlers
// to the HTTP response message to use the specified stream transformations.
if (stream is not null)
{
// Note: StreamContent.LoadIntoBufferAsync is deliberately used to force the stream
// content to be buffered so that can it can be read multiple times if needed
// (e.g if the JSON deserialization process fails, the stream is read as a string
// during a second pass a second time for logging/debuggability purposes).
var content = new StreamContent(stream);
await content.LoadIntoBufferAsync();
// Copy the headers from the original content to the new instance.
foreach (var header in response.Content.Headers)

5
test/OpenIddict.Abstractions.Tests/Primitives/OpenIddictExtensionsTests.cs

@ -2127,7 +2127,7 @@ public class OpenIddictExtensionsTests
var identity = new ClaimsIdentity();
// Act
identity.AddClaims("type", JsonSerializer.Deserialize<JsonElement>(@"[""Fabrikam"",""Contoso""]"), "issuer");
identity.AddClaims("type", JsonSerializer.Deserialize<JsonElement>(@"[""Fabrikam"",""Contoso"",42]"), "issuer");
// Assert
var claims = identity.FindAll("type").ToArray();
@ -2137,6 +2137,9 @@ public class OpenIddictExtensionsTests
Assert.Equal("Contoso", claims[1].Value);
Assert.Equal(ClaimValueTypes.String, claims[1].ValueType);
Assert.Equal("issuer", claims[1].Issuer);
Assert.Equal("42", claims[2].Value);
Assert.Equal(ClaimValueTypes.Integer32, claims[2].ValueType);
Assert.Equal("issuer", claims[2].Issuer);
}
[Fact]

Loading…
Cancel
Save