mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
2cdd4761c8
* Add digest auth and response timeline * Some css fixes * Fixed Button * More auth methods, fixed URL regex, and fix gzip * Get rid of negotiate auth * Fix proxy * Fixed GA tracking * Some very small changes and fixes * Fix content type names * Even better auth switching and timeline syntax * Some auth tweaks * CSS tweaks * Reworked toasts * Fixed timer rounding quirk * Request settings and render errors * Fixed tests * Vertical dragging and stuff * Remove beta
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import React, {PropTypes, PureComponent} from 'react';
|
|
import CopyButton from '../base/copy-button';
|
|
|
|
class ResponseHeadersViewer extends PureComponent {
|
|
render () {
|
|
const {headers} = this.props;
|
|
|
|
const headersString = headers.map(
|
|
h => `${h.name}: ${h.value}`
|
|
).join('\n');
|
|
|
|
return (
|
|
<div>
|
|
<table className="table--fancy table--striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{headers.map((h, i) => (
|
|
<tr className="selectable" key={i}>
|
|
<td style={{width: '50%'}} className="force-wrap">{h.name}</td>
|
|
<td style={{width: '50%'}} className="force-wrap">{h.value}</td>
|
|
</tr>
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
<p className="pad-top">
|
|
<CopyButton
|
|
className="pull-right btn btn--clicky"
|
|
content={headersString}
|
|
/>
|
|
</p>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
ResponseHeadersViewer.propTypes = {
|
|
headers: PropTypes.array.isRequired
|
|
};
|
|
|
|
export default ResponseHeadersViewer;
|