Revision dccd42eb snf-cyclades-app/synnefo/api/delegate.py
b/snf-cyclades-app/synnefo/api/delegate.py | ||
---|---|---|
53 | 53 |
logger = logging.getLogger(__name__) |
54 | 54 |
|
55 | 55 |
|
56 |
def delegate_to_login_service(request): |
|
57 |
url = USER_LOGIN_URL |
|
58 |
if not url: |
|
59 |
return HttpResponseNotFound() |
|
60 |
|
|
61 |
p = urlparse(url) |
|
62 |
if request.is_secure(): |
|
63 |
proto = 'https://' |
|
64 |
else: |
|
65 |
proto = 'http://' |
|
66 |
params = dict([(k, v) for k, v in request.GET.items()]) |
|
67 |
uri = proto + p.netloc + p.path + '?' + urlencode(params) |
|
68 |
return HttpResponseRedirect(uri) |
|
69 |
|
|
70 |
|
|
71 | 56 |
def proxy(request, url, headers={}, body=None): |
72 | 57 |
p = urlparse(url) |
73 | 58 |
|
Also available in: Unified diff