@@ -154,14 +154,15 @@ public async Task SignInCausesDefaultCookieToBeCreated()
154
154
[ Fact ]
155
155
public async Task CustomAuthSchemeEncodesCookieName ( )
156
156
{
157
- using var host = await CreateHostWithServices ( s => s . AddAuthentication ( "With Spaces" ) . AddCookie ( "With Spaces" , o =>
157
+ var schemeName = "With spaces and 界" ;
158
+ using var host = await CreateHostWithServices ( s => s . AddAuthentication ( schemeName ) . AddCookie ( schemeName , o =>
158
159
{
159
160
o . LoginPath = new PathString ( "/login" ) ;
160
161
} ) , context =>
161
162
{
162
163
var user = new ClaimsIdentity ( new GenericIdentity ( "Alice" , "Cookies" ) ) ;
163
164
user . AddClaim ( new Claim ( "marker" , "true" ) ) ;
164
- return context . SignInAsync ( "With Spaces" ,
165
+ return context . SignInAsync ( schemeName ,
165
166
new ClaimsPrincipal ( user ) ,
166
167
new AuthenticationProperties ( ) ) ;
167
168
} ) ;
@@ -170,7 +171,7 @@ public async Task CustomAuthSchemeEncodesCookieName()
170
171
var transaction = await SendAsync ( server , "http://example.com/testpath" ) ;
171
172
172
173
var setCookie = transaction . SetCookie ;
173
- Assert . StartsWith ( ".AspNetCore.With%20Spaces =" , setCookie ) ;
174
+ Assert . StartsWith ( ".AspNetCore.With%20spaces%20and%20%E7%95%8C =" , setCookie ) ;
174
175
Assert . Contains ( "; path=/" , setCookie ) ;
175
176
Assert . Contains ( "; httponly" , setCookie ) ;
176
177
Assert . Contains ( "; samesite=" , setCookie ) ;
0 commit comments