mockaton 13.0.0 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -99,7 +99,11 @@ async function updatePayloadViewer(proxied, file, response) {
|
|
|
99
99
|
? PayloadViewerTitleWhenProxied(response)
|
|
100
100
|
: PayloadViewerTitle(file, response.statusText))
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
if (!response.ok) {
|
|
103
|
+
codeRef.elem.textContent = await bodyAsText()
|
|
104
|
+
return
|
|
105
|
+
}
|
|
106
|
+
|
|
103
107
|
if (mime.startsWith('image/'))
|
|
104
108
|
codeRef.elem.replaceChildren(r('img', {
|
|
105
109
|
src: URL.createObjectURL(await response.blob())
|
|
@@ -138,8 +142,8 @@ async function updatePayloadViewer(proxied, file, response) {
|
|
|
138
142
|
}, t`Download`))
|
|
139
143
|
|
|
140
144
|
|
|
141
|
-
function bodyAsText() {
|
|
142
|
-
return response.text() || t`/* Empty Response Body */`
|
|
145
|
+
async function bodyAsText() {
|
|
146
|
+
return (await response.text()) || t`/* Empty Response Body */`
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
|