From fef30bc671a448644f06eac7fa6fbb295d4368c6 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 25 Sep 2024 12:35:30 -0600 Subject: [PATCH] Peroparly handle text based responses (#13964) --- frigate/api/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frigate/api/app.py b/frigate/api/app.py index 6b6a232fe..d4e3b41b6 100644 --- a/frigate/api/app.py +++ b/frigate/api/app.py @@ -13,7 +13,7 @@ import requests from fastapi import APIRouter, Path, Request, Response from fastapi.encoders import jsonable_encoder from fastapi.params import Depends -from fastapi.responses import JSONResponse +from fastapi.responses import JSONResponse, PlainTextResponse from markupsafe import escape from peewee import operator @@ -37,7 +37,7 @@ logger = logging.getLogger(__name__) router = APIRouter(tags=[Tags.app]) -@router.get("/") +@router.get("/", response_class=PlainTextResponse) def is_healthy(): return "Frigate is running. Alive and healthy!" @@ -82,9 +82,9 @@ def go2rtc_camera_stream(camera_name: str): return JSONResponse(content=stream_data) -@router.get("/version") +@router.get("/version", response_class=PlainTextResponse) def version(): - return JSONResponse(content=VERSION, media_type="text/html", status_code=200) + return VERSION @router.get("/stats")