You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/04/17 05:23:09 UTC

[GitHub] [apisix-dashboard] qian0817 commented on a change in pull request #1779: feat: Improve debug view

qian0817 commented on a change in pull request #1779:
URL: https://github.com/apache/apisix-dashboard/pull/1779#discussion_r615209618



##########
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') {

Review comment:
       > It would be better to use `resp.header['Content-Type']` as judging condition, just like Line244 does
   
   In the backend implementation, if it can be parsed as json then return object type otherwise return string type, there is no check on content-type.




-- 
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:
users@infra.apache.org