Implement HTTP OPTIONS request on /avatar

Returns the list of allowed values for the default option.
This commit is contained in:
Tristan Le Guern
2019-03-01 00:25:28 +00:00
parent a2a0b4a68d
commit 8e1d498501
2 changed files with 6 additions and 0 deletions

View File

@@ -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