jazzband / django-waffle

A feature flipper for Django
https://waffle.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.13k stars 259 forks source link

Support setting testing flags with http headers #405

Closed jsatt closed 3 years ago

jsatt commented 3 years ago

Using flag testing within a backend API doesn't work as well when you have to trigger the flag via a query params. I believe that using HTTP headers is a more natural way of indicating these flags for an API. This PR adds support for checking headers for DWFT-Flag-Name to enable/disable the flag the same as using the query params. This shouldn't affect the existing functionality, simply make Waffle more flexible for additional use cases.

clintonb commented 3 years ago

@jsatt fix the tests, and I'll re-approve.

jsatt commented 3 years ago

@clintonb tests (and Django 2.2 support) should be fixed. Let's take another swing at it.