Files
hoppscotch/components/lenses/renderers/mixins/TextContentRendererMixin.js
2020-09-17 21:36:36 -04:00

17 lines
393 B
JavaScript

export default {
props: {
response: {},
},
computed: {
responseBodyText() {
if (typeof this.response.body === "string") return this.response.body
else {
const res = new TextDecoder("utf-8").decode(this.response.body)
// HACK: Temporary trailing null character issue from the extension fix
return res.replace(/\0+$/, "")
}
},
},
}