Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamicSiteIDMiddleware fails when application when the request.host is an IPv6 address #82

Open
comandrei opened this issue Nov 22, 2017 · 0 comments

Comments

@comandrei
Copy link

Environment:

Django==1.8.18
djangotoolbox==1.8.0
Python 2.7.6

When performing a request as http://[2406:da00:ff00::36f3:801a]:80, the process_request method will throw a ValueError while unpacking the host to determine domain/port combination.

def process_request(self, request):
        # Ignore port if it's 80 or 443
        if ':' in request.get_host():
            domain, port = request.get_host().split(':')
            if int(port) not in (80, 443):
                domain = request.get_host()
        else:
            domain = request.get_host().split(':')[0]
comandrei pushed a commit to comandrei/djangotoolbox that referenced this issue Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant