MCPcopy Create free account
hub / github.com/Effect-TS/effect / toClientBody

Function toClientBody

packages/effect/src/http/HttpServerRequest.ts:496–508  ·  view source on GitHub ↗
(request: HttpServerRequest)

Source from the content-addressed store, hash-verified

494}
495
496const toClientBody = (request: HttpServerRequest): HttpBody.HttpBody => {
497 if (!hasBody(request.method)) {
498 return HttpBody.empty
499 }
500 const formData = getFormDataBody(request)
501 return formData === undefined
502 ? HttpBody.stream(
503 request.stream,
504 request.headers["content-type"],
505 bodyInternal.parseContentLength(request.headers["content-length"])
506 )
507 : HttpBody.formData(formData)
508}
509
510const removeHost = (url: string) => {
511 if (url[0] === "/") {

Callers 1

toClientRequestFunction · 0.85

Calls 4

hasBodyFunction · 0.90
getFormDataBodyFunction · 0.85
streamMethod · 0.65
formDataMethod · 0.45

Tested by

no test coverage detected