Skip to content

Commit

Permalink
Require GET for healthz and readiness endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
mhieta committed Nov 7, 2023
1 parent a4daa0c commit 714257d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions project/urls.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
from django.contrib import admin
from django.http import HttpResponse
from django.urls import include, path
from django.views.decorators.http import require_GET
from django.views.generic import RedirectView
from drf_yasg import openapi
from drf_yasg.views import get_schema_view


@require_GET
def healthz(*args, **kwargs):
"""Returns status code 200 if the server is alive."""
return HttpResponse(status=200)


@require_GET
def readiness(*args, **kwargs):
"""
Returns status code 200 if the server is ready to perform its duties.
Expand Down

0 comments on commit 714257d

Please sign in to comment.