Closed corentin-larose closed 6 years ago
Honestly, I think this would have general utility for any PSR-7/PSR-15 middleware application, not just Stratigility. Have you considered shipping it as a standalone package?
Hello,
Yes, this is what I wanted to say when writing "Should that middleware be provided as a "module"?". Ok, I will create a standalone package and come back to you guys for comments. What do you think about the configuration options I proposed? I will also come back with a standalone port of my zf-http-cache module.
Then, trying to find a repository to put that codeI just found this: https://github.com/middlewares/method-override. So I close this issue
Awesome to see it already exists! Make sure to contribute to it if you find it is missing functionality you need. :smile:
GET
andPOST
through his proxy.GET
andPOST
in forms.I propose to create a middleware overriding the HTTP method when
_method
parameter is provided in theGET
orPOST
payload (ie?_method=DELETE
).Some options I also consider:
_method
$_GET
or$_POST
) corresponding to the HTTP method used for the request (GET
orPOST
)validateMethod
has been derived from the request trait.If interest shown, I will create the file and unit tests in a PR. Should that middleware be provided as a "module"?