Issues

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

Description


$request = new \Zend\Http\Request;
$request->setMethod('post');
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.

Comments

Fixed with PR 651.

PR merged