Skip to content

Commit ec25d19

Browse files
author
Brent Schmaltz
committed
reduced size for netcorestandard2.1 compression size is larger.
1 parent b16f758 commit ec25d19

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3617,7 +3617,11 @@ public static TheoryData<JWEDecompressionTheoryData> JweDecompressSizeTheoryData
36173617

36183618
TheoryData<JWEDecompressionTheoryData> theoryData = new TheoryData<JWEDecompressionTheoryData>();
36193619

3620+
#if NETCOREAPP2_1
3621+
string payload = System.Text.Json.JsonSerializer.Serialize(new { U = new string('U', 20_000_000), UU = new string('U', 15_000_000) });
3622+
#else
36203623
string payload = System.Text.Json.JsonSerializer.Serialize(new { U = new string('U', 100_000_000), UU = new string('U', 40_000_000) });
3624+
#endif
36213625
string token = jwth.CreateToken(payload, encryptingCredentials, "DEF");
36223626
theoryData.Add(new JWEDecompressionTheoryData
36233627
{

test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,11 @@ public static TheoryData<JWEDecompressionTheoryData> JweDecompressSizeTheoryData
11481148

11491149
TheoryData<JWEDecompressionTheoryData> theoryData = new TheoryData<JWEDecompressionTheoryData>();
11501150

1151+
#if NETCOREAPP2_1
1152+
string payload = System.Text.Json.JsonSerializer.Serialize(new { U = new string('U', 20_000_000), UU = new string('U', 15_000_000) });
1153+
#else
11511154
string payload = System.Text.Json.JsonSerializer.Serialize(new { U = new string('U', 100_000_000), UU = new string('U', 40_000_000) });
1155+
#endif
11521156
string token = jwth.CreateToken(payload, encryptingCredentials, "DEF");
11531157
theoryData.Add(new JWEDecompressionTheoryData
11541158
{

0 commit comments

Comments
 (0)