Guess content type if no header present
Summary: Changelog: [Network] The network plugin will now detect utf-8 strings if no content header is present Fixes https://github.com/facebook/flipper/issues/2406 Reviewed By: nikoant Differential Revision: D29388968 fbshipit-source-id: 7017828a5f3f28dcf220eeda1d30888f1fc5f07a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2b0ce88c22
commit
9f27b374f4
@@ -23,13 +23,7 @@ import {
|
||||
} from 'flipper-plugin';
|
||||
import {Select, Typography} from 'antd';
|
||||
|
||||
import {
|
||||
bodyAsBinary,
|
||||
bodyAsString,
|
||||
formatBytes,
|
||||
getHeaderValue,
|
||||
isTextual,
|
||||
} from './utils';
|
||||
import {bodyAsBinary, bodyAsString, formatBytes, getHeaderValue} from './utils';
|
||||
import {Request, Header, Insights, RetryInsights} from './types';
|
||||
import {BodyOptions} from './index';
|
||||
import {ProtobufDefinitionsRepository} from './ProtobufDefinitionsRepository';
|
||||
@@ -95,7 +89,7 @@ export default class RequestDetails extends Component<RequestDetailsProps> {
|
||||
key="requestData"
|
||||
title={'Request Body'}
|
||||
extraActions={
|
||||
isTextual(request.requestHeaders) ? (
|
||||
typeof request.requestData === 'string' ? (
|
||||
<CopyOutlined
|
||||
title="Copy request body"
|
||||
onClick={(e) => {
|
||||
@@ -129,7 +123,8 @@ export default class RequestDetails extends Component<RequestDetailsProps> {
|
||||
request.responseIsMock ? ' (Mocked)' : ''
|
||||
}`}
|
||||
extraActions={
|
||||
isTextual(request.responseHeaders) && request.responseData ? (
|
||||
typeof request.responseData === 'string' &&
|
||||
request.responseData ? (
|
||||
<CopyOutlined
|
||||
title="Copy response body"
|
||||
onClick={(e) => {
|
||||
|
||||
Reference in New Issue
Block a user