2024-04-05 18:46:44 +02:00
|
|
|
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)
|
2024-03-01 11:55:17 +01:00
|
|
|
|