@ -1,5 +1,6 @@
@@ -1,5 +1,6 @@
using System ;
using System.Collections.Generic ;
using System.Linq ;
using System.Net ;
using System.Net.Http ;
using System.Text ;
@ -975,7 +976,19 @@ namespace Bit.Core.Services
@@ -975,7 +976,19 @@ namespace Bit.Core.Services
private bool IsJsonResponse ( HttpResponseMessage response )
{
return ( response . Content ? . Headers ? . ContentType ? . MediaType ? ? string . Empty ) = = "application/json" ;
if ( response . Content ? . Headers is null )
{
return false ;
}
if ( response . Content . Headers . ContentType ? . MediaType = = "application/json" )
{
return true ;
}
return response . Content . Headers . TryGetValues ( "Content-Type" , out var vals )
& &
vals ? . Any ( v = > v . Contains ( "application/json" ) ) is true ;
}
# endregion