fix(spec): render response body for non-200 responses (#9555)
Refs #9556
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import YAML, { JSON_SCHEMA } from "js-yaml"
|
||||
import { Map as ImmutableMap } from "immutable"
|
||||
import parseUrl from "url-parse"
|
||||
import { serializeError } from "serialize-error"
|
||||
import isString from "lodash/isString"
|
||||
import debounce from "lodash/debounce"
|
||||
import set from "lodash/set"
|
||||
@@ -482,7 +481,7 @@ export const executeRequest = (req) =>
|
||||
err.message = "**Failed to fetch.** \n**Possible Reasons:** \n - CORS \n - Network Failure \n - URL scheme must be \"http\" or \"https\" for CORS request."
|
||||
}
|
||||
specActions.setResponse(req.pathName, req.method, {
|
||||
error: true, err: serializeError(err)
|
||||
error: true, err
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
@@ -123,8 +123,8 @@ export default {
|
||||
let newState = state.setIn( [ "responses", path, method ], fromJSOrdered(result) )
|
||||
|
||||
// ImmutableJS messes up Blob. Needs to reset its value.
|
||||
if (win.Blob && res.data instanceof win.Blob) {
|
||||
newState = newState.setIn( [ "responses", path, method, "text" ], res.data)
|
||||
if (win.Blob && result.data instanceof win.Blob) {
|
||||
newState = newState.setIn( [ "responses", path, method, "text" ], result.data)
|
||||
}
|
||||
return newState
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user