qian0817 commented on a change in pull request #1779: URL: https://github.com/apache/apisix-dashboard/pull/1779#discussion_r615210411
########## File path: web/src/pages/Route/components/DebugViews/DebugDrawView.tsx ########## @@ -229,8 +233,23 @@ const DebugDrawView: React.FC<RouteModule.DebugDrawProps> = (props) => { }, bodyFormData) .then((req) => { setLoading(false); - setResponseBody(JSON.stringify(req.data.data, null, 2)); - setResponseHeader(JSON.stringify(req.data.header, null, 2)); + const resp: RouteModule.debugResponse= req.data; + if (typeof (resp.data) !== 'string') { + resp.data = JSON.stringify(resp.data, null, 2); + } + setResponse(resp); + const contentType=resp.header["Content-Type"]; + if (contentType == null || contentType.length !== 1) { Review comment: > May I ask why not merge this judgment condition to the Line 250? I need to check content-type is not null first. Is there a better way to write it? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org