Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 58aefba

Browse files
committed
Fix rogue obsoletes
1 parent dc2f73e commit 58aefba

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

src/Microsoft.AspNetCore.Authentication.Core/AuthenticationHandlerProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public async Task<IAuthenticationHandler> GetHandlerAsync(HttpContext context, s
2424
{
2525
if (_handlerMap.ContainsKey(authenticationScheme))
2626
{
27-
return _handlerMap[authenticationScheme[Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", error: true)];
27+
return _handlerMap[authenticationScheme];
2828
}
2929

3030
var scheme = await Schemes.GetSchemeAsync(authenticationScheme);
@@ -38,7 +38,7 @@ public async Task<IAuthenticationHandler> GetHandlerAsync(HttpContext context, s
3838
if (handler != null)
3939
{
4040
await handler.InitializeAsync(scheme, context);
41-
_handlerMap[authenticationScheme[Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", error: true)] = handler;
41+
_handlerMap[authenticationScheme] = handler;
4242
}
4343
return handler;
4444
}

src/Microsoft.AspNetCore.Authentication.Core/AuthenticationSchemeProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Task<AuthenticationScheme> GetSchemeAsync(string name)
7777
{
7878
if (_map.ContainsKey(name))
7979
{
80-
return Task.FromResult(_map[name[Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", error: true)]);
80+
return Task.FromResult(_map[name]);
8181
}
8282
return Task.FromResult<AuthenticationScheme>(null);
8383
}
@@ -103,7 +103,7 @@ public void AddScheme(AuthenticationScheme scheme)
103103
{
104104
_requestHandlers.Add(scheme);
105105
}
106-
_map[scheme.Name[Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", error: true)] = scheme;
106+
_map[scheme.Name] = scheme;
107107
}
108108
}
109109

@@ -117,7 +117,7 @@ public void RemoveScheme(string name)
117117
{
118118
if (_map.ContainsKey(name))
119119
{
120-
var scheme = _map[name[Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", error: true)];
120+
var scheme = _map[name];
121121
_requestHandlers.Remove(_requestHandlers.Where(s => s.Name == name).FirstOrDefault());
122122
_map.Remove(name);
123123
}

src/Microsoft.AspNetCore.Authentication.Core/Properties/Resources.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Microsoft.AspNetCore.Authentication.Core/Resources.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
2121
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
2222
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23-
<value>[base64 mime encoded serialized .NET Framework object[Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", error: true)]</value>
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
2424
</data>
2525
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26-
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object[Obsolete("See https://go.microsoft.com/fwlink/?linkid=845470", error: true)]</value>
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
2929

test/Microsoft.AspNetCore.Http.Tests/DefaultHttpContextTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ void TestAllCachedFeaturesAreNull(HttpContext context, IFeatureCollection featur
191191
TestCachedFeaturesAreNull(context, features);
192192
TestCachedFeaturesAreNull(context.Request, features);
193193
TestCachedFeaturesAreNull(context.Response, features);
194+
#pragma warning disable 618
194195
TestCachedFeaturesAreNull(context.Authentication, features);
196+
#pragma warning restore 618
195197
TestCachedFeaturesAreNull(context.Connection, features);
196198
TestCachedFeaturesAreNull(context.WebSockets, features);
197199
}
@@ -220,7 +222,9 @@ void TestAllCachedFeaturesAreSet(HttpContext context, IFeatureCollection feature
220222
TestCachedFeaturesAreSet(context, features);
221223
TestCachedFeaturesAreSet(context.Request, features);
222224
TestCachedFeaturesAreSet(context.Response, features);
225+
#pragma warning disable 618
223226
TestCachedFeaturesAreSet(context.Authentication, features);
227+
#pragma warning restore 618
224228
TestCachedFeaturesAreSet(context.Connection, features);
225229
TestCachedFeaturesAreSet(context.WebSockets, features);
226230
}

0 commit comments

Comments
 (0)