mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
parent
732d3bb805
commit
8fa948e402
@ -2,6 +2,7 @@ import React, {PropTypes, PureComponent} from 'react';
|
||||
import iconv from 'iconv-lite';
|
||||
import autobind from 'autobind-decorator';
|
||||
import {shell} from 'electron';
|
||||
import {SimplePDF} from 'simple-react-pdf';
|
||||
import CodeEditor from '../codemirror/code-editor';
|
||||
import ResponseWebView from './response-webview';
|
||||
import ResponseRaw from './response-raw';
|
||||
@ -151,6 +152,17 @@ class ResponseViewer extends PureComponent {
|
||||
url={url}
|
||||
/>
|
||||
);
|
||||
} else if (previewMode === PREVIEW_MODE_FRIENDLY && ct.indexOf('application/pdf') === 0) {
|
||||
const justContentType = contentType.split(';')[0];
|
||||
return (
|
||||
<div className="scrollable-container tall wide">
|
||||
<div className="scrollable">
|
||||
<SimplePDF
|
||||
file={`data:${justContentType};base64,${base64Body}`}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} else if (previewMode === PREVIEW_MODE_RAW) {
|
||||
const match = contentType.match(/charset=([\w-]+)/);
|
||||
const charset = (match && match.length >= 2) ? match[1] : 'utf-8';
|
||||
|
@ -140,6 +140,7 @@
|
||||
"redux": "3.3.1",
|
||||
"redux-thunk": "2.0.1",
|
||||
"reselect": "2.5.4",
|
||||
"simple-react-pdf": "^1.0.8",
|
||||
"srp-js": "0.2.0",
|
||||
"tough-cookie": "2.3.1",
|
||||
"uuid": "3.0.0",
|
||||
|
Loading…
Reference in New Issue
Block a user