Support IndexNox

This commit is contained in:
Konstantin 2024-04-05 18:46:44 +02:00
parent 6bd0df1f34
commit 9b4bb6c9f1
5 changed files with 53 additions and 4 deletions

View file

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