Open igorsantos07 opened 6 years ago
That's not possible since a request object is immutable, so even if it's modified there is no way other class will know about this :/
I think we can calculate Content-length manually only if it was not already set in request.
I'm using the curl-client to run SOAP requests from Phpro/SoapClient. It includes a debug method that brings up request and response headers, so we can inspect what's going on. I also instantiated a PluginClient with a LoggerPlugin, just to be on the safe side. I'm debugging a supposedly missing
Content-Length
header my server is complaining about.A request I'm running reports on those two types of logs the header
Content-Length: 1150
, while the body actually has 1596 chars. After a lot of digging around, I found that those loggers refer to headers inside theRequestInterface
object, while theContent-Length
header is silently changed insideHttp\Client\Curl\Client::createHeaders()
- but only passed as cURL options, and not upwards as well.For the sanity of other developers, this value should also be changed on the request object. I'm not doing a PR as I don't even know if that object is supposed to be modified, or the best way to do it around here.