Files
hoppscotch/packages/hoppscotch-common/src/components/lenses/renderers/mixins/TextContentRendererMixin.js
2023-12-06 21:24:29 +05:30

16 lines
367 B
JavaScript

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