Give allowed methods in invalid method response

also a typo
This commit is contained in:
Chris Boden 2016-12-30 14:08:20 -05:00
parent ee3233ef5e
commit 889857a5e3
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ interface NegotiatorInterface {
* @param boolean $enable
* @todo Consider extending this interface and moving this there.
* The spec does says the server can fail for this reason, but
it is not a requirement. This is an implementation detail.
* it is not a requirement. This is an implementation detail.
*/
function setStrictSubProtocolCheck($enable);
}

View File

@ -40,7 +40,7 @@ class ServerNegotiator implements NegotiatorInterface {
*/
public function handshake(RequestInterface $request) {
if (true !== $this->verifier->verifyMethod($request->getMethod())) {
return new Response(405);
return new Response(405, ['Allow' => 'GET']);
}
if (true !== $this->verifier->verifyHTTPVersion($request->getProtocolVersion())) {