From 8e1d49850189235dfd898a2ab5620d343397fc8a Mon Sep 17 00:00:00 2001 From: Tristan Le Guern Date: Fri, 1 Mar 2019 00:25:28 +0000 Subject: [PATCH 1/2] Implement HTTP OPTIONS request on /avatar Returns the list of allowed values for the default option. --- ivatar/urls.py | 1 + ivatar/views.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ivatar/urls.py b/ivatar/urls.py index 1609c9f..a7a4870 100644 --- a/ivatar/urls.py +++ b/ivatar/urls.py @@ -21,6 +21,7 @@ urlpatterns = [ # pylint: disable=invalid-name url( r'avatar/(?P\w{32})', AvatarImageView.as_view(), name='avatar_view'), + url(r'avatar/$', AvatarImageView.as_view(), name='avatar_view'), url( r'avatar/(?P\w*)', TemplateView.as_view( diff --git a/ivatar/views.py b/ivatar/views.py index a50b571..3564e62 100644 --- a/ivatar/views.py +++ b/ivatar/views.py @@ -58,6 +58,11 @@ class AvatarImageView(TemplateView): ''' # TODO: Do cache resize images!! Memcached? + def options(self, request, *args, **kwargs): # pylint: disable=too-many-branches,too-many-statements,too-many-locals,too-many-return-statements + response = HttpResponse("", content_type='text/plain') + response['Allow'] = "404 mm mp retro pagan wavatar monsterid robohash identicon" + return response + def get(self, request, *args, **kwargs): # pylint: disable=too-many-branches,too-many-statements,too-many-locals,too-many-return-statements ''' Override get from parent class From 33bebba4236b685f098492b1f5f1f64087afd374 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Mon, 4 Mar 2019 11:23:28 +0100 Subject: [PATCH 2/2] Make all panels the same size --- ivatar/tools/templates/check.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ivatar/tools/templates/check.html b/ivatar/tools/templates/check.html index 9e86eb4..9e80266 100644 --- a/ivatar/tools/templates/check.html +++ b/ivatar/tools/templates/check.html @@ -21,7 +21,7 @@
{% if mailurl %} -
+

MD5  

@@ -44,7 +44,7 @@ {% endif %} {% if openidurl %} -
+

SHA256