Skip to content

Commit 5550108

Browse files
authored
fix: Unnecessary regex path definitions for /metrics, /version, healthcheck routes (#36)
1 parent ca396df commit 5550108

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/common/core/urls.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from django.conf import settings
2-
from django.urls import include, re_path
2+
from django.urls import include, path, re_path
33

44
from common.core import views
55

66
urlpatterns = [
7-
re_path(r"^version/?", views.version_info),
8-
re_path(r"^health/liveness/?", views.liveness),
9-
re_path(r"^health/readiness/?", include("health_check.urls", namespace="health")),
7+
path(r"^version/?", views.version_info),
8+
path(r"^health/liveness/?", views.liveness),
9+
path(r"^health/readiness/?", include("health_check.urls", namespace="health")),
1010
re_path(r"^health", include("health_check.urls", namespace="health-deprecated")),
1111
# Aptible health checks must be on /healthcheck and cannot redirect
1212
# see https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/https-endpoints/health-checks
1313
re_path(r"^healthcheck", include("health_check.urls", namespace="health-aptible")),
1414
]
1515

1616
if settings.PROMETHEUS_ENABLED:
17-
urlpatterns += [re_path(r"^metrics/?", views.metrics)]
17+
urlpatterns += [path("metrics", views.metrics)]

0 commit comments

Comments
 (0)