Skip to content

Commit

Permalink
Patched introduction/apis.py
Browse files Browse the repository at this point in the history
  • Loading branch information
patched.codes[bot] committed May 2, 2024
1 parent 59da551 commit e6a6ad3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions introduction/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ def ssrf_code_checker(request):
else:
return JsonResponse({'message':'UnAuthenticated User'},status = 401)

# Insufficient Logging & Monitoring

from django.http import JsonResponse, HttpResponseForbidden
from django.views.decorators.csrf import ensure_csrf_cookie
from rest_framework.response import Response
from rest_framework import status
import os
import requests

@csrf_exempt
# @authentication_decorator
@ensure_csrf_cookie
def log_function_checker(request):
if request.method == 'POST':
csrf_token = request.POST.get("csrfmiddlewaretoken")
Expand Down Expand Up @@ -87,7 +90,7 @@ def log_function_checker(request):
f.close()
return JsonResponse({"message":"success", "logs": lines},status = 200)
else:
return JsonResponse({"message":"method not allowed"},status = 405)
return HttpResponseForbidden()

#a7 codechecking api
@csrf_exempt
Expand Down

0 comments on commit e6a6ad3

Please sign in to comment.