Skip to content

Commit

Permalink
fix: do not use "Content-Encoding" header as buffer encoding (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito authored Oct 12, 2023
1 parent 5b2172b commit 1f57355
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/HttpMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,8 @@ export class HttpMessage {
) {
const fetchHeaders = new Headers(this.rawHeaders)

this.encoding = (fetchHeaders.get('Content-Encoding') ||
undefined) as BufferEncoding

this.mimeType = fetchHeaders.get('Content-Type') || ''
this.bodySize =
body == null ? 0 : Buffer.from(body, this.encoding).byteLength
this.bodySize = body == null ? 0 : Buffer.from(body).byteLength

const headerLines = toHeaderLines(this.rawHeaders)

Expand Down

0 comments on commit 1f57355

Please sign in to comment.