martenframework / marten

The pragmatic web framework.
https://martenframework.com
MIT License
396 stars 21 forks source link

Override method #218

Closed treagod closed 3 months ago

treagod commented 3 months ago

This PR introduces a new Middleware which allows to override the request method if a valid _method key is present in the request body.

It also introduces a tag helper which shall prevent typos and make it easier to define the _method form input.

Closes #215

treagod commented 3 months ago

One more thing: do you see this middleware as a default for Marten? Or should it be up to the project to decide wether the override mechanism is needed?

ellmetha commented 3 months ago

 One more thing: do you see this middleware as a default for Marten? Or should it be up to the project to decide wether the override mechanism is needed?

IMHO this should not be one of the default middlewares (in generated projects) as I expect most projects won't need this functionality at all. Each project can decide to use it if this becomes necessary! 🙂