Skip to content

Commit

Permalink
fix: handling of headers in builder
Browse files Browse the repository at this point in the history
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
  • Loading branch information
CarstenLeue committed Jan 9, 2024
1 parent 813b83b commit 38c6541
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ioeither/http/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,17 @@ func (builder *Builder) Requester() IOEH.Requester {
)),
)

return F.Pipe5(
return F.Pipe6(
builder,
Body.Get,
O.Fold(LZ.Of(IOE.Of[error](withoutBody)), IOE.Map[error](withBody)),
IOG.Map[IOE.IOEither[error, func(string) func(string) IOE.IOEither[error, *http.Request]], IOE.IOEither[error, func(string) IOE.IOEither[error, *http.Request]]](E.Ap[func(string) IOE.IOEither[error, *http.Request]](targetUrl)),
IOE.Flap[error, IOE.IOEither[error, *http.Request]](builder.GetMethod()),
IOE.Flatten[error, *http.Request],
IOE.Map[error](func(req *http.Request) *http.Request {
req.Header = H.Monoid.Concat(req.Header, builder.GetHeaders())
return req
}),
)
}

Expand Down

0 comments on commit 38c6541

Please sign in to comment.