From bd8aedbc718e47ac2d7c1cd252bf99413501b0ee Mon Sep 17 00:00:00 2001 From: Robert Rollins Date: Tue, 19 Apr 2016 13:24:53 -0700 Subject: [PATCH] Updated Page.dummy_request() to be able to handle ALLOWED_HOSTS = ['*']. --- wagtail/wagtailcore/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index c9a6409f6b..5ab9acd2fd 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -1194,6 +1194,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 = '/'