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



##########
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:
       @liuxiran For example, if the Content-Type is `text/plain` but the 
returned content is `{}`, the backend will parse it as json type. I don't know 
why it was designed this way in the first place, but if I change the backend 
code, this PR will not be backward compatible.




-- 
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


Reply via email to