Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
--********************************************************************/

using System;
using System.Management.Automation;
using System.Text;
using Microsoft.Win32;

Expand Down Expand Up @@ -87,7 +88,8 @@ private static bool CheckIsText(string contentType)
|| CheckIsXml(contentType)
|| CheckIsJson(contentType);

if (!isText)
// Further content type analysis is available on Windows
if (Platform.IsWindows && !isText)
{
// Media types registered with Windows as having a perceived type of text, are text
using (RegistryKey contentTypeKey = Registry.ClassesRoot.OpenSubKey(@"MIME\Database\Content Type\" + contentType))
Expand Down Expand Up @@ -135,7 +137,7 @@ private static bool CheckIsJson(string contentType)
// the correct type for JSON content, as specified in RFC 4627
bool isJson = contentType.Equals("application/json", StringComparison.OrdinalIgnoreCase);

// add in these other "javascript" related types that
// add in these other "javascript" related types that
// sometimes get sent down as the mime type for JSON content
isJson |= contentType.Equals("text/json", StringComparison.OrdinalIgnoreCase)
|| contentType.Equals("application/x-javascript", StringComparison.OrdinalIgnoreCase)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.