File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/Microsoft.Graph.Core/Requests Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,8 @@ private static async Task ThrowIfFailedResponseAsync(HttpResponseMessage httpRes
108
108
{
109
109
if ( httpResponseMessage . IsSuccessStatusCode ) return ;
110
110
111
- if ( CoreConstants . MimeTypeNames . Application . Json . Equals ( httpResponseMessage . Content ? . Headers ? . ContentType ? . MediaType , StringComparison . OrdinalIgnoreCase ) )
111
+ var contentTypeString = httpResponseMessage . Content ? . Headers ? . ContentType ? . MediaType is { } contentTypeMediaType && ! string . IsNullOrEmpty ( contentTypeMediaType ) ? contentTypeMediaType : string . Empty ;
112
+ if ( httpResponseMessage . Content != null && contentTypeString . StartsWith ( CoreConstants . MimeTypeNames . Application . Json , StringComparison . OrdinalIgnoreCase ) )
112
113
{
113
114
using var responseContent = await httpResponseMessage . Content . ReadAsStreamAsync ( ) . ConfigureAwait ( false ) ;
114
115
using var document = await JsonDocument . ParseAsync ( responseContent ) . ConfigureAwait ( false ) ;
You can’t perform that action at this time.
0 commit comments