Add Clacks Overhead header on each response. Closes #84
Signed-off-by: Yohann D'ANELLO <yohann.danello@gmail.com>
This commit is contained in:
parent
893534955d
commit
d9c97628e2
2 changed files with 15 additions and 0 deletions
|
|
@ -142,3 +142,17 @@ class TurbolinksMiddleware(object):
|
|||
location = request.session.pop('_turbolinks_redirect_to')
|
||||
response['Turbolinks-Location'] = location
|
||||
return response
|
||||
|
||||
|
||||
class ClacksMiddleware(object):
|
||||
"""
|
||||
Add Clacks Overhead header on each response.
|
||||
See https://www.gnuterrypratchett.com/
|
||||
"""
|
||||
def __init__(self, get_response):
|
||||
self.get_response = get_response
|
||||
|
||||
def __call__(self, request):
|
||||
response = self.get_response(request)
|
||||
response['X-Clacks-Overhead'] = 'GNU Terry Pratchett'
|
||||
return response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue