Effect CommunityEC
Effect Community3y ago
19 replies
Patrick Roza

Issue with URL Prepending in Default Client

@Tim Smart this bit me today:
defaultClient.pipe(
  Client.mapRequest(ClientRequest.prependUrl("http://abc")),
  Client.tapRequest((r) =>
    Effect
      .logDebug(`[HTTP] ${r.method}`)
      .annotateLogs("url", r.url)
  )
)(ClientRequest.get("/a"))
url ends up in log without http://abc
until you move the mapRequest after the tap which seems a little counter intuitive
Was this page helpful?