Sttp client with restricted headers

Hello,

We just integrated tapir with sttp client in our project, and we found an impediment: we need to send the “host” header along, which is a restricted header for the underlying java HTTP client.

I have found that we can circumvent this with -Djdk.httpclient.allowRestrictedHeaders=host

However, we do not want to maintain this java option. Is there another method we can use for using this header? Or should we just switch to a different backend (I’m thinking of http4s, since we need cats effect integration)

Java 21, sttp client4 1.12.3

Thank you!

I’m afraid the only customisation option here (when using a HttpClient-based backend) is to rely on the options provided by the JDK. So if you cannot use that, I recommed looking at the http4s or Armeria-based backends.