mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2026-09-24 14:20:08 +01:00
add userAgent and version to healthcheck
This commit is contained in:
+2
-1
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user