Ignore:
Timestamp:
May 29, 2010, 10:34:45 PM (15 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, fysm-4-1, space-access, stable, stage, test-hooks
Children:
d67c1c1
Parents:
00e16ed
git-author:
Alex Dehnert <adehnert@…> (05/29/10 22:34:45)
git-committer:
Alex Dehnert <adehnert@…> (05/29/10 22:34:45)
Message:

localhost check needs to use portless-HTTP_HOST

As a bonus, this gets around the problem that the Django dev server doesn't
set REQUEST_URI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/mit/__init__.py

    r4f37035 r1c68fbb  
    4747
    4848def scripts_login(request, **kwargs):
    49     if request.META['HTTP_HOST'] == 'localhost':
     49    host = request.META['HTTP_HOST'].split(':')[0]
     50    if host == 'localhost':
    5051        return login(request, **kwargs)
    5152    elif request.META['SERVER_PORT'] == '444':
     
    6566    else:
    6667        # Move to port 444
    67         host = request.META['HTTP_HOST'].split(':')[0]
    6868        redirect_to = "https://%s:444%s" % (host, request.META['REQUEST_URI'], )
    6969        return HttpResponseRedirect(redirect_to)
Note: See TracChangeset for help on using the changeset viewer.