Skip to content

Commit 9931536

Browse files
author
Andrea Cosentino
committed
fix: setting response header content-length
1 parent a541d70 commit 9931536

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/utils/utils.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,10 +1277,13 @@ export const Utils = {
12771277
try {
12781278
if ([null, undefined].includes(responseData.data)) {
12791279
responseData.data = this.NO_RESPONSE;
1280-
responseData.headers = [
1281-
...responseData.headers,
1282-
{ "name": "content-length", value: 0 }
1283-
]
1280+
const hasContentLength = responseData.headers.some(h => h.name.toLowerCase() === "content-length");
1281+
if (!hasContentLength) {
1282+
responseData.headers = [
1283+
...responseData.headers,
1284+
{ "name": "content-length", value: 0 }
1285+
];
1286+
}
12841287
} else {
12851288
responseData.data = JSON.stringify(responseData.data);
12861289
}

0 commit comments

Comments
 (0)