EdgeAIG's picture
download
raw
688 Bytes
import * as Effect from "../../../Effect.ts"
import type { PreResponseHandler } from "../HttpEffect.ts"
import type { HttpServerRequest } from "../HttpServerRequest.ts"
/** @internal */
export const requestPreResponseHandlers = new WeakMap<object, PreResponseHandler>()
/** @internal */
export const appendPreResponseHandlerUnsafe = (request: HttpServerRequest, handler: PreResponseHandler): void => {
const prev = requestPreResponseHandlers.get(request.source)
const next: PreResponseHandler = prev ?
(request, response) => Effect.flatMap(prev(request, response), (response) => handler(request, response))
: handler
requestPreResponseHandlers.set(request.source, next)
}

Xet Storage Details

Size:
688 Bytes
·
Xet hash:
4d311e811b9aec1c31eab5508133067ddfbbab0d285caea5b7334836cfb0afe0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.