Skip to content

Commit d5eea2c

Browse files
committed
Cast Content-Length to string.
1 parent 25d1fb1 commit d5eea2c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Encoder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ test("Has correct headers", async t => {
4848

4949
t.deepEqual(encoder.headers, {
5050
"Content-Type": `multipart/form-data; boundary=${encoder.boundary}`,
51-
"Content-Length": await readStream(encoder).then(({length}) => length)
51+
"Content-Length": await readStream(encoder).then(({length}) => `${length}`)
5252
})
5353
})
5454

lib/Encoder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class Encoder {
2222
*/
2323
readonly headers: {
2424
"Content-Type": string
25-
"Content-Length": number
25+
"Content-Length": string
2626
}
2727

2828
readonly #CRLF: string
@@ -90,7 +90,7 @@ export class Encoder {
9090

9191
this.headers = Object.freeze({
9292
"Content-Type": this.contentType,
93-
"Content-Length": this.getContentLength()
93+
"Content-Length": String(this.getContentLength())
9494
})
9595
}
9696

0 commit comments

Comments
 (0)