Skip to content

Content-Length header is misleading #35

Open
@igorsantos07

Description

@igorsantos07

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 the RequestInterface object, while the Content-Length header is silently changed inside Http\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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions