Merge branch 'main' into refactor/ui
This commit is contained in:
@@ -10,10 +10,10 @@
|
|||||||
<component :is="lens.renderer" :response="response" />
|
<component :is="lens.renderer" :response="response" />
|
||||||
</SmartTab>
|
</SmartTab>
|
||||||
<SmartTab
|
<SmartTab
|
||||||
v-if="Object.keys(response.headers).length !== 0"
|
v-if="headerLength"
|
||||||
id="headers"
|
id="headers"
|
||||||
:label="$t('Headers')"
|
:label="$t('Headers')"
|
||||||
:info="Object.keys(response.headers).length.toString()"
|
:info="headerLength.toString()"
|
||||||
>
|
>
|
||||||
<LensesHeadersRenderer :headers="response.headers" />
|
<LensesHeadersRenderer :headers="response.headers" />
|
||||||
</SmartTab>
|
</SmartTab>
|
||||||
@@ -32,7 +32,14 @@ export default {
|
|||||||
response: { type: Object, default: () => {} },
|
response: { type: Object, default: () => {} },
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
headerLength() {
|
||||||
|
if (!this.response || !this.response.headers) return 0
|
||||||
|
|
||||||
|
return Object.keys(this.response.headers).length
|
||||||
|
},
|
||||||
validLenses() {
|
validLenses() {
|
||||||
|
if (!this.response) return []
|
||||||
|
|
||||||
return getSuitableLenses(this.response)
|
return getSuitableLenses(this.response)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1160,10 +1160,11 @@ export default defineComponent({
|
|||||||
// tests
|
// tests
|
||||||
const syntheticResponse = {
|
const syntheticResponse = {
|
||||||
status: this.response.status,
|
status: this.response.status,
|
||||||
body: this.response.body,
|
body: this.response.body || new Uint8Array([]),
|
||||||
headers: this.response.headers,
|
headers: this.response.headers || [],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.response.body = this.response.body || new Uint8Array([])
|
||||||
// Parse JSON body
|
// Parse JSON body
|
||||||
if (
|
if (
|
||||||
syntheticResponse.headers["content-type"] &&
|
syntheticResponse.headers["content-type"] &&
|
||||||
|
|||||||
Reference in New Issue
Block a user