Set the User-Agent header when purging cache

This commit is contained in:
Karl Hobley 2015-07-08 17:35:41 +01:00
parent 0731e77c0f
commit 064aaa654b

View file

@ -5,6 +5,8 @@ from django.utils.six.moves.urllib.parse import urlparse, urlunparse, urlencode
from django.utils.six.moves.urllib.request import Request, urlopen
from django.utils.six.moves.urllib.error import URLError, HTTPError
from wagtail.wagtailcore import __version__
logger = logging.getLogger('wagtail.frontendcache')
@ -39,6 +41,7 @@ class HTTPBackend(BaseBackend):
]),
headers={
'Host': host,
'User-Agent': 'Wagtail-frontendcache/' + __version__
},
method='PURGE'
)