diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2009-07-10 19:14:09 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2009-07-10 19:14:09 -0400 |
commit | 5b45e526c74faf55110ff0afdcba19797d7e0f4d (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /django_authopenid/middleware.py | |
parent | bb801f2bbd9f26bebca846b71e8947a1951f86a5 (diff) | |
download | askbot-5b45e526c74faf55110ff0afdcba19797d7e0f4d.tar.gz askbot-5b45e526c74faf55110ff0afdcba19797d7e0f4d.tar.bz2 askbot-5b45e526c74faf55110ff0afdcba19797d7e0f4d.zip |
deleted all
Diffstat (limited to 'django_authopenid/middleware.py')
-rw-r--r-- | django_authopenid/middleware.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/django_authopenid/middleware.py b/django_authopenid/middleware.py deleted file mode 100644 index c0572c6e..00000000 --- a/django_authopenid/middleware.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from django_authopenid import mimeparse -from django.http import HttpResponseRedirect -from django.core.urlresolvers import reverse - -__all__ = ["OpenIDMiddleware"] - -class OpenIDMiddleware(object): - """ - Populate request.openid. This comes either from cookie or from - session, depending on the presence of OPENID_USE_SESSIONS. - """ - def process_request(self, request): - request.openid = request.session.get('openid', None) - - def process_response(self, request, response): - if response.status_code != 200 or len(response.content) < 200: - return response - path = request.get_full_path() - if path == "/" and request.META.has_key('HTTP_ACCEPT') and \ - mimeparse.best_match(['text/html', 'application/xrds+xml'], - request.META['HTTP_ACCEPT']) == 'application/xrds+xml': - return HttpResponseRedirect(reverse('yadis_xrdf')) - return response
\ No newline at end of file |