Skip to content

Commit

Permalink
common: fix auth http body
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Aug 9, 2024
1 parent 1bd7f37 commit c15fe42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/src/fetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ export function createStringOrBufferBody(headers: [string, string][], body: any)

if (!hasHeader(headers, 'Content-Type'))
setHeader(headers, 'Content-Type', contentType);

if (!hasHeader(headers, 'Content-Length')) {
body = Buffer.from(body);
setHeader(headers, 'Content-Length', body.length.toString());
}
return body;
}

Expand Down

0 comments on commit c15fe42

Please sign in to comment.