Skip to content

Support "Allow" header for 405 errors #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jakejohns
Copy link
Contributor

The HTTP 405 Method Not Allowed client error response status code indicates that the server knows the request method, but the target resource doesn't support this method. The server must generate an Allow header in a 405 response with a list of methods that the target resource currently supports.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405

@oscarotero
Copy link
Member

Thanks!

I think instead of a new allow method, it's better to have a more generic headers method.

protected function allow(ResponseInterface $response, Throwable $error): ResponseInterface

The method can check if the getHeaders method exists in the $error instance and apply these headers to the response.

@filisko
Copy link
Member

filisko commented Apr 24, 2025

@jakejohns Hi, trying to close this - Any updates?

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

Successfully merging this pull request may close these issues.

3 participants