1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

ensure no path specific in duo host (#1985)

This commit is contained in:
Kyle Spearrin 2022-05-09 16:00:00 -04:00 committed by GitHub
parent 3ffd240287
commit 06c9b123f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,8 @@ namespace Bit.Core.Utilities.Duo
{
if (Uri.TryCreate($"https://{host}", UriKind.Absolute, out var uri))
{
return uri.Host.StartsWith("api-") &&
return (string.IsNullOrWhiteSpace(uri.PathAndQuery) || uri.PathAndQuery == "/") &&
uri.Host.StartsWith("api-") &&
(uri.Host.EndsWith(".duosecurity.com") || uri.Host.EndsWith(".duofederal.com"));
}
return false;