Migrate to .net6.0 (#3198)

This commit is contained in:
Nicolas Dorier
2021-12-27 13:15:43 +09:00
committed by GitHub
parent 4a66c91cac
commit 02419dcdd1
23 changed files with 42 additions and 58 deletions

View File

@@ -14,13 +14,13 @@ namespace BTCPayServer.Security.GreenField
{
public static bool GetAPIKey(this HttpContext httpContext, out StringValues apiKey)
{
apiKey = default;
if (httpContext.Request.Headers.TryGetValue("Authorization", out var value) &&
value.ToString().StartsWith("token ", StringComparison.InvariantCultureIgnoreCase))
{
apiKey = value.ToString().Substring("token ".Length);
return true;
}
return false;
}