Skip to content

Commit

Permalink
fix: dont override content-length header when doing html injection
Browse files Browse the repository at this point in the history
  • Loading branch information
VitaliyR committed Jan 13, 2025
1 parent 97ee472 commit 5ef70f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,11 @@ const initializeProxy = async function ({

if (htmlInjections) {
responseBody = await injectHtml(responseBody, proxyRes, htmlInjections)
proxyResHeaders = {
...proxyResHeaders,
'content-length': String(responseBody.byteLength),
if (!proxyResHeaders['transfer-encoding']) {
proxyResHeaders = {
...proxyResHeaders,
'content-length': String(responseBody.byteLength),
}
}
}

Expand Down

0 comments on commit 5ef70f4

Please sign in to comment.