Patch Changes
-
#2387
75a8d16
Thanks @tim-smart! - add Cookies module to /platform httpTo add cookies to a http response:
import * as Http from "@effect/platform/HttpServer"; Http.response.empty().pipe( Http.response.setCookies([ ["name", "value"], ["foo", "bar", { httpOnly: true }], ]), );
You can also use cookies with the http client:
import * as Http from "@effect/platform/HttpClient"; import { Effect, Ref } from "effect"; Effect.gen(function* (_) { const ref = yield* _(Ref.make(Http.cookies.empty)); const defaultClient = yield* _(Http.client.Client); const clientWithCookies = defaultClient.pipe( Http.client.withCookiesRef(ref), Http.client.filterStatusOk, ); // cookies will be stored in the ref and sent in any subsequent requests yield* _( Http.request.get("https://www.google.com/"), clientWithCookies, Effect.scoped, ); });
-
#2385
3307729
Thanks @tim-smart! - update typescript to 5.4 -
Updated dependencies [
75a8d16
,3307729
]:- @effect/platform-node-shared@0.3.16
- @effect/platform@0.48.16
- effect@2.4.12