@@ -154,14 +154,15 @@ public async Task SignInCausesDefaultCookieToBeCreated()
154154 [ Fact ]
155155 public async Task CustomAuthSchemeEncodesCookieName ( )
156156 {
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 =>
158159 {
159160 o . LoginPath = new PathString ( "/login" ) ;
160161 } ) , context =>
161162 {
162163 var user = new ClaimsIdentity ( new GenericIdentity ( "Alice" , "Cookies" ) ) ;
163164 user . AddClaim ( new Claim ( "marker" , "true" ) ) ;
164- return context . SignInAsync ( "With Spaces" ,
165+ return context . SignInAsync ( schemeName ,
165166 new ClaimsPrincipal ( user ) ,
166167 new AuthenticationProperties ( ) ) ;
167168 } ) ;
@@ -170,7 +171,7 @@ public async Task CustomAuthSchemeEncodesCookieName()
170171 var transaction = await SendAsync ( server , "http://example.com/testpath" ) ;
171172
172173 var setCookie = transaction . SetCookie ;
173- Assert . StartsWith ( ".AspNetCore.With%20Spaces =" , setCookie ) ;
174+ Assert . StartsWith ( ".AspNetCore.With%20spaces%20and%20%E7%95%8C =" , setCookie ) ;
174175 Assert . Contains ( "; path=/" , setCookie ) ;
175176 Assert . Contains ( "; httponly" , setCookie ) ;
176177 Assert . Contains ( "; samesite=" , setCookie ) ;
0 commit comments