add userAgent and version to healthcheck

This commit is contained in:
ThePhaseless
2025-04-17 11:27:17 +00:00
parent 409c0f9d8c
commit fe797ba2ac
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ from sbase import BaseCase
from src.consts import CHALLENGE_TITLES
from src.models import (
HealthcheckResponse,
LinkRequest,
LinkResponse,
Solution,
@@ -41,7 +42,7 @@ def health_check(sb: SeleniumDep):
detail="Health check failed",
)
return {"status": "ok"}
return HealthcheckResponse(user_agent=sb.get_user_agent())
@router.post("/v1")
+7
View File
@@ -19,6 +19,13 @@ class LinkRequest(BaseModel):
max_timeout: int = Field(default=60)
class HealthcheckResponse(BaseModel):
model_config = {"alias_generator": to_camel, "populate_by_name": True}
msg: str = "Byparr is ready!"
version: str = consts.VERSION
user_agent: str
class Solution(BaseModel):
url: str
status: int