also handle lowercase headers
This commit is contained in:
parent
0252d39bb6
commit
93169eca1e
|
@ -80,7 +80,7 @@ abstract class Controller {
|
|||
|
||||
// return the first matching responder
|
||||
foreach ($headers as $header) {
|
||||
$header = trim($header);
|
||||
$header = strtolower(trim($header));
|
||||
|
||||
$responder = str_replace('application/', '', $header);
|
||||
|
||||
|
|
|
@ -185,4 +185,13 @@ class ControllerTest extends \PHPUnit_Framework_TestCase {
|
|||
}
|
||||
|
||||
|
||||
public function testResponderAcceptHeaderParsedUpperCase() {
|
||||
$responder = $this->controller->getResponderByHTTPHeader(
|
||||
'*/*, apPlication/ToM, application/json'
|
||||
);
|
||||
|
||||
$this->assertEquals('tom', $responder);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue