Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.

Zend_Http_Exception "Invalid header value detected" on POST with Zend_Http_Client #569

Closed
delassiter opened this issue May 20, 2015 · 1 comment

Comments

@delassiter
Copy link

In Zend Framework 1.12.12 I have found an issue when POSTing with a body using Zend_Http_Client.
I always receive a Zend_Http_Exception with the Message

Invalid header value detected

It is thrown in the _validateHeaderValue method because of the value of the Content-Length header being neither a string, nor an object nor having a method __toString(). The Content-Length is also set by the Zend_Http_Client in method _prepareBody

        // Set the Content-Length if we have a body or if request is POST/PUT
        if ($body || $this->method == self::POST || $this->method == self::PUT) {
            $this->setHeaders(self::CONTENT_LENGTH, strlen($body));
        }

strlen($body) of course delivers an integer, so the Exception will be thrown

@froschdesign
Copy link
Member

Already done: #567

Please look also at the closed tickets: #568 and #566

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

No branches or pull requests

2 participants