mirror of
https://github.com/IBM/fp-go.git
synced 2025-08-10 22:31:32 +02:00
fix: handling of headers in builder
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
@@ -266,13 +266,17 @@ func (builder *Builder) Requester() IOEH.Requester {
|
|||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
|
|
||||||
return F.Pipe5(
|
return F.Pipe6(
|
||||||
builder,
|
builder,
|
||||||
Body.Get,
|
Body.Get,
|
||||||
O.Fold(LZ.Of(IOE.Of[error](withoutBody)), IOE.Map[error](withBody)),
|
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)),
|
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.Flap[error, IOE.IOEither[error, *http.Request]](builder.GetMethod()),
|
||||||
IOE.Flatten[error, *http.Request],
|
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
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user