File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
src/Microsoft.OpenApi/Models Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -171,8 +171,7 @@ private static string GetContentType(string url)
171
171
{
172
172
var response = _httpClient . GetAsync ( url ) . GetAwaiter ( ) . GetResult ( ) ;
173
173
var mediaType = response . Content . Headers . ContentType . MediaType ;
174
- var contentType = mediaType . Split ( ";" . ToCharArray ( ) , StringSplitOptions . RemoveEmptyEntries ) . First ( ) ;
175
- return contentType . Split ( '/' ) . LastOrDefault ( ) ;
174
+ return mediaType . Split ( ";" . ToCharArray ( ) , StringSplitOptions . RemoveEmptyEntries ) . First ( ) ;
176
175
}
177
176
178
177
return null ;
@@ -188,7 +187,7 @@ private static string GetFormat(string url)
188
187
var path = new Uri ( url ) ;
189
188
var urlSuffix = path . Segments [ path . Segments . Length - 1 ] . Split ( '.' ) . LastOrDefault ( ) ;
190
189
191
- return ! string . IsNullOrEmpty ( urlSuffix ) ? urlSuffix : GetContentType ( url ) ;
190
+ return ! string . IsNullOrEmpty ( urlSuffix ) ? urlSuffix : GetContentType ( url ) . Split ( '/' ) . LastOrDefault ( ) ;
192
191
}
193
192
else
194
193
{
You can’t perform that action at this time.
0 commit comments