zendframework / zend-diactoros

PSR-7 HTTP Message implementation
BSD 3-Clause "New" or "Revised" License
1.55k stars 152 forks source link

Do not allow an invalid HTTP method for requests #302

Closed weierophinney closed 6 years ago

weierophinney commented 6 years ago

This patch rebases and fixes the patch introduced with #162.

Internally, it modifies how the RequestTrait works to ensure that the HTTP method is always valid; this allows removal of duplicated code in the ServerRequest, as well as a conditional and exception from the request serializer.

Considering PSR-17 requires an HTTP method to its various request factories, this brings Diactoros in line with that proposed spec.