From af3643a77c26faca8ad9c53f173fc4245456c42b Mon Sep 17 00:00:00 2001 From: Raman Maksimchuk Date: Tue, 16 Apr 2024 19:19:36 +0300 Subject: [PATCH] Fix compiling errors --- src/Ocelot/Configuration/AuthenticationOptions.cs | 2 +- .../Configuration/Builder/AuthenticationOptionsBuilder.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ocelot/Configuration/AuthenticationOptions.cs b/src/Ocelot/Configuration/AuthenticationOptions.cs index 8484a8bb10..77ff959eac 100644 --- a/src/Ocelot/Configuration/AuthenticationOptions.cs +++ b/src/Ocelot/Configuration/AuthenticationOptions.cs @@ -39,7 +39,7 @@ public AuthenticationOptions(List allowedScopes, string[] authentication /// New to build. private void BuildAuthenticationProviderKeys(string legacyKey, string[] keys) { - keys ??= new string[]; + keys ??= Array.Empty(); if (string.IsNullOrEmpty(legacyKey)) { return; diff --git a/src/Ocelot/Configuration/Builder/AuthenticationOptionsBuilder.cs b/src/Ocelot/Configuration/Builder/AuthenticationOptionsBuilder.cs index 50b7e9ae45..85faf259e6 100644 --- a/src/Ocelot/Configuration/Builder/AuthenticationOptionsBuilder.cs +++ b/src/Ocelot/Configuration/Builder/AuthenticationOptionsBuilder.cs @@ -25,9 +25,9 @@ public AuthenticationOptionsBuilder WithRequiredRole(List requiredRole) [Obsolete("Use the " + nameof(WithAuthenticationProviderKeys) + " property!")] public AuthenticationOptionsBuilder WithAuthenticationProviderKey(string authenticationProviderKey) - => WithAuthenticationProviderKeys([authenticationProviderKey]); + => WithAuthenticationProviderKeys(authenticationProviderKey); - public AuthenticationOptionsBuilder WithAuthenticationProviderKeys(string[] authenticationProviderKeys) + public AuthenticationOptionsBuilder WithAuthenticationProviderKeys(params string[] authenticationProviderKeys) { _authenticationProviderKeys = authenticationProviderKeys; return this;