Support IndexNox
This commit is contained in:
parent
6bd0df1f34
commit
9b4bb6c9f1
5 changed files with 53 additions and 4 deletions
|
@ -1,3 +1,14 @@
|
|||
from django.shortcuts import render
|
||||
from django.conf import settings
|
||||
from django.http import Http404, HttpResponse
|
||||
from django.utils.crypto import constant_time_compare
|
||||
from django.views import View
|
||||
from base.indexnow import get_key
|
||||
|
||||
|
||||
class KeyView(View):
|
||||
def get(self, request, key):
|
||||
if not constant_time_compare(key, get_key()):
|
||||
raise Http404()
|
||||
|
||||
return HttpResponse(key)
|
||||
|
||||
# Create your views here.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue