Changeset 8842


Ignore:
Timestamp:
11/12/13 09:01:44 (6 years ago)
Author:
mnagni
Message:

Fixes a redirection problem in case of multiple virtual hosts inside the same Apache instance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/dj_security_middleware/trunk/dj_security_middleware/middleware.py

    r8836 r8842  
    158158 
    159159def _build_url(request): 
    160     hostname = request.environ.get('HOSTNAME', socket.getfqdn()) 
     160    hostname = request.environ.get('HTTP_HOST', socket.getfqdn()) 
    161161    #hostname = socket.getfqdn()     
    162162    new_get = request.GET.copy() 
     
    167167    new_get.pop(LOGOUT, None) 
    168168 
    169     if request.META['SERVER_PORT'] != 80: 
    170         hostname = "%s:%s" % (hostname, request.META['SERVER_PORT']) 
     169    #if request.META['SERVER_PORT'] != 80: 
     170    #    hostname = "%s:%s" % (hostname, request.META['SERVER_PORT']) 
    171171    return 'http://%s%s?%s' % (hostname,  
    172172                               request.path,  
Note: See TracChangeset for help on using the changeset viewer.