@effect/platform 0.69.0 → 0.69.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/HttpApiBuilder.js +2 -0
- package/dist/cjs/HttpApiBuilder.js.map +1 -1
- package/dist/cjs/HttpApiMiddleware.js.map +1 -1
- package/dist/cjs/HttpApp.js +47 -36
- package/dist/cjs/HttpApp.js.map +1 -1
- package/dist/cjs/internal/httpMiddleware.js +3 -6
- package/dist/cjs/internal/httpMiddleware.js.map +1 -1
- package/dist/dts/HttpApiBuilder.d.ts +2 -0
- package/dist/dts/HttpApiBuilder.d.ts.map +1 -1
- package/dist/dts/HttpApiMiddleware.d.ts +10 -13
- package/dist/dts/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/dts/HttpApp.d.ts +1 -1
- package/dist/dts/HttpApp.d.ts.map +1 -1
- package/dist/esm/HttpApiBuilder.js +2 -0
- package/dist/esm/HttpApiBuilder.js.map +1 -1
- package/dist/esm/HttpApiMiddleware.js.map +1 -1
- package/dist/esm/HttpApp.js +47 -36
- package/dist/esm/HttpApp.js.map +1 -1
- package/dist/esm/internal/httpMiddleware.js +3 -6
- package/dist/esm/internal/httpMiddleware.js.map +1 -1
- package/package.json +1 -1
- package/src/HttpApiBuilder.ts +2 -0
- package/src/HttpApiMiddleware.ts +25 -26
- package/src/HttpApp.ts +67 -43
- package/src/internal/httpMiddleware.ts +3 -6
|
@@ -76,8 +76,7 @@ export const withTracerDisabledForUrls = dual<
|
|
|
76
76
|
export const logger = make((httpApp) => {
|
|
77
77
|
let counter = 0
|
|
78
78
|
return Effect.withFiberRuntime((fiber) => {
|
|
79
|
-
const
|
|
80
|
-
const request = Context.unsafeGet(context, ServerRequest.HttpServerRequest)
|
|
79
|
+
const request = Context.unsafeGet(fiber.currentContext, ServerRequest.HttpServerRequest)
|
|
81
80
|
return Effect.withLogSpan(
|
|
82
81
|
Effect.flatMap(Effect.exit(httpApp), (exit) => {
|
|
83
82
|
if (fiber.getFiberRef(loggerDisabled)) {
|
|
@@ -110,8 +109,7 @@ export const logger = make((httpApp) => {
|
|
|
110
109
|
/** @internal */
|
|
111
110
|
export const tracer = make((httpApp) =>
|
|
112
111
|
Effect.withFiberRuntime((fiber) => {
|
|
113
|
-
const
|
|
114
|
-
const request = Context.unsafeGet(context, ServerRequest.HttpServerRequest)
|
|
112
|
+
const request = Context.unsafeGet(fiber.currentContext, ServerRequest.HttpServerRequest)
|
|
115
113
|
const disabled = fiber.getFiberRef(currentTracerDisabledWhen)(request)
|
|
116
114
|
if (disabled) {
|
|
117
115
|
return httpApp
|
|
@@ -303,8 +301,7 @@ export const cors = (options?: {
|
|
|
303
301
|
|
|
304
302
|
return <E, R>(httpApp: App.Default<E, R>): App.Default<E, R> =>
|
|
305
303
|
Effect.withFiberRuntime((fiber) => {
|
|
306
|
-
const
|
|
307
|
-
const request = Context.unsafeGet(context, ServerRequest.HttpServerRequest)
|
|
304
|
+
const request = Context.unsafeGet(fiber.currentContext, ServerRequest.HttpServerRequest)
|
|
308
305
|
if (request.method === "OPTIONS") {
|
|
309
306
|
return Effect.succeed(ServerResponse.empty({
|
|
310
307
|
status: 204,
|