Skip to content

Commit e50df01

Browse files
authored
fix(lambda-edge): satisfy Deno lib types for Content-Length body encoding (#5013)
1 parent fce483e commit e50df01

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/adapter/lambda-edge/handler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ const createRequest = (event: CloudFrontEdgeEvent): Request => {
168168

169169
let body: string | Uint8Array<ArrayBuffer> | undefined = rawBody
170170
if (rawBody !== undefined) {
171-
const bytes = typeof rawBody === 'string' ? new TextEncoder().encode(rawBody) : rawBody
171+
const bytes =
172+
typeof rawBody === 'string'
173+
? (new TextEncoder().encode(rawBody) as Uint8Array<ArrayBuffer>)
174+
: rawBody
172175
body = bytes
173176
headers.set('content-length', bytes.length.toString())
174177
}

0 commit comments

Comments
 (0)