diff --git a/components/lenses/ResponseBodyRenderer.vue b/components/lenses/ResponseBodyRenderer.vue index 479ec91a3..5fbbbb1bc 100644 --- a/components/lenses/ResponseBodyRenderer.vue +++ b/components/lenses/ResponseBodyRenderer.vue @@ -10,10 +10,10 @@ @@ -32,7 +32,14 @@ export default { response: { type: Object, default: () => {} }, }, computed: { + headerLength() { + if (!this.response || !this.response.headers) return 0 + + return Object.keys(this.response.headers).length + }, validLenses() { + if (!this.response) return [] + return getSuitableLenses(this.response) }, }, diff --git a/pages/index.vue b/pages/index.vue index 695b03d23..018210489 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1160,10 +1160,11 @@ export default defineComponent({ // tests const syntheticResponse = { status: this.response.status, - body: this.response.body, - headers: this.response.headers, + body: this.response.body || new Uint8Array([]), + headers: this.response.headers || [], } + this.response.body = this.response.body || new Uint8Array([]) // Parse JSON body if ( syntheticResponse.headers["content-type"] &&