mitsuhiko/flask — pull request #582 by jperras (2012-08-27 21:29:05+00:00)
Title: Implement support for X-HTTP-Method-Override in flask.views.MethodView.

When an incoming request contains the X-HTTP-Method-Override header, the
value of that header is used as the view method to be executed instead
of the original incoming HTTP verb.

This helps support dumb(er) webservers and proxies that don't understand newer HTTP verbs (e.g. PATCH), of which Amazon's Elastic Load Balancer service is a member.

I only added the functionality to `flask.views.MethodView`, because I was unsure about what would be a good way to do it with the standard `dispatch_request`; developers often introspect the HTTP method inside of decorator-based routes when supporting more than one verb in a route, so should the `request.method` value be overridden completely, or should devs be required to check for the X-HTTP-Method-Override header themselves? Neither option seems very appealing to me.