Charcode for webview (Fixes #1045)

This commit is contained in:
Gregory Schier 2018-07-16 08:54:18 -04:00
parent 794646f2ac
commit d5bc716918

View File

@ -286,13 +286,12 @@ class ResponseViewer extends React.Component<Props, State> {
</div>
);
} else if (previewMode === PREVIEW_MODE_FRIENDLY && ct.includes('html')) {
const justContentType = contentType.split(';')[0];
const match = contentType.match(/charset=([\w-]+)/);
const charset = match && match.length >= 2 ? match[1] : 'utf-8';
return (
<ResponseWebView
body={this._decodeIconv(bodyBuffer, charset)}
contentType={justContentType}
contentType={contentType}
url={url}
/>
);