mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-13 01:33:16 +00:00
Updated Page.dummy_request() to be able to handle ALLOWED_HOSTS = ['*'].
This commit is contained in:
parent
e70bd15179
commit
efceeba241
1 changed files with 4 additions and 0 deletions
|
|
@ -1220,6 +1220,10 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed
|
|||
# whatever we find in ALLOWED_HOSTS
|
||||
try:
|
||||
hostname = settings.ALLOWED_HOSTS[0]
|
||||
if hostname == '*':
|
||||
# '*' is a valid value to find in ALLOWED_HOSTS[0], but it's not a valid domain name.
|
||||
# So we pretend it isn't there.
|
||||
raise IndexError
|
||||
except IndexError:
|
||||
hostname = 'localhost'
|
||||
path = '/'
|
||||
|
|
|
|||
Loading…
Reference in a new issue