Skip to content

Commit

Permalink
fix http ServerResponse cookie apis (#2698)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored May 5, 2024
1 parent 25616b8 commit 5866c62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-pens-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/platform": patch
---

fix http ServerResponse cookie apis
4 changes: 2 additions & 2 deletions packages/platform/src/internal/http/serverResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const setCookie = dual<
options?: Cookies.Cookie["options"]
) => Effect.Effect<ServerResponse.ServerResponse, Cookies.CookiesError>
>(
(args) => Cookies.isCookies(args[0]),
(args) => isServerResponse(args[0]),
(self, name, value, options) =>
Effect.map(Cookies.set(self.cookies, name, value, options), (cookies) =>
new ServerResponseImpl(
Expand All @@ -347,7 +347,7 @@ export const unsafeSetCookie = dual<
options?: Cookies.Cookie["options"]
) => ServerResponse.ServerResponse
>(
(args) => Cookies.isCookies(args[0]),
(args) => isServerResponse(args[0]),
(self, name, value, options) =>
new ServerResponseImpl(
self.status,
Expand Down

0 comments on commit 5866c62

Please sign in to comment.