ZF2-114: Zend\Http\Request setMethod() should automatically strtoupper the method name

Issue Type: Bug Created: 2011-12-06T15:03:56.000+0000 Last Updated: 2011-12-06T23:00:30.000+0000 Status: Resolved Fix version(s): Reporter: Evan Coury ( Assignee: Evan Coury ( Tags: - Zend\Http

Related issues: Attachments:


<pre class="highlight">
$request = new \Zend\Http\Request;
echo $request->getMethod(); // output is lowercase 'post'

For web servers that adhere strictly to the HTTP standard (like nginx), this will cause a 400/Unknown method error. Zend\Http\Request should automatically convert the string passed to setMethod() to uppercase.

Additionally, Zend\Http\Client::setMethod() should utilize the "uppercased" method returned after setting the method in the request when checking the method type to see if calling setEncType is necessary.


Posted by Evan Coury ( on 2011-12-06T15:25:00.000+0000

Fixed with PR 651.

Posted by Rob Allen (rob) on 2011-12-06T23:00:29.000+0000

PR merged

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.