Skip to content

Commit

Permalink
fix HttpServerRequest.arrayBuffer for bun & web handlers (#4353)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored Jan 28, 2025
1 parent 9172efb commit 8f6006a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changeset/old-moose-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@effect/platform-bun": patch
"@effect/platform": patch
---

fix HttpServerRequest.arrayBuffer for bun & web handlers
4 changes: 2 additions & 2 deletions packages/platform-bun/src/internal/httpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ class ServerRequestImpl extends Inspectable.Class implements ServerRequest.HttpS

private arrayBufferEffect: Effect.Effect<ArrayBuffer, Error.RequestError> | undefined
get arrayBuffer(): Effect.Effect<ArrayBuffer, Error.RequestError> {
if (this.arrayBuffer) {
return this.arrayBuffer
if (this.arrayBufferEffect) {
return this.arrayBufferEffect
}
this.arrayBufferEffect = Effect.runSync(Effect.cached(
Effect.tryPromise({
Expand Down
4 changes: 2 additions & 2 deletions packages/platform/src/internal/httpServerRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ class ServerRequestImpl extends Inspectable.Class implements ServerRequest.HttpS

private arrayBufferEffect: Effect.Effect<ArrayBuffer, Error.RequestError> | undefined
get arrayBuffer(): Effect.Effect<ArrayBuffer, Error.RequestError> {
if (this.arrayBuffer) {
return this.arrayBuffer
if (this.arrayBufferEffect) {
return this.arrayBufferEffect
}
this.arrayBufferEffect = Effect.runSync(Effect.cached(
Effect.tryPromise({
Expand Down

0 comments on commit 8f6006a

Please sign in to comment.