Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Length header is misleading #35

Open
igorsantos07 opened this issue Feb 6, 2018 · 2 comments
Open

Content-Length header is misleading #35

igorsantos07 opened this issue Feb 6, 2018 · 2 comments
Assignees

Comments

@igorsantos07
Copy link

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.

@joelwurtz
Copy link
Member

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 :/

@mekras mekras self-assigned this Mar 26, 2018
@mekras
Copy link
Collaborator

mekras commented Mar 26, 2018

I think we can calculate Content-length manually only if it was not already set in request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants