@@ -40,6 +40,8 @@ class Platform:
4040 presence_strings : tuple [str , ...] = ()
4141 url_probe : str | None = None
4242 check_method : str = "status"
43+ probe_method : str = "GET"
44+ probe_body : dict | None = None
4345
4446
4547BUILTIN_YAML = Path (__file__ ).resolve ().parent .parent / "modules" / "platforms.yaml"
@@ -84,6 +86,12 @@ def _coerce(entry: dict[str, Any]) -> Platform:
8486 check_method = entry .get ("check_method" , "status" )
8587 if check_method not in ("status" , "message" , "response_url" ):
8688 raise ValueError (f"platform { name !r} invalid check_method { check_method !r} " )
89+ probe_method = entry .get ("probe_method" , "GET" )
90+ if probe_method not in ("GET" , "POST" ):
91+ raise ValueError (f"platform { name !r} invalid probe_method { probe_method !r} " )
92+ probe_body = entry .get ("probe_body" )
93+ if probe_body is not None and not isinstance (probe_body , dict ):
94+ raise ValueError (f"platform { name !r} probe_body must be a mapping" )
8795 return Platform (
8896 name = name ,
8997 url = url ,
@@ -100,6 +108,8 @@ def _coerce(entry: dict[str, Any]) -> Platform:
100108 presence_strings = tuple (str (s ) for s in presence if str (s ).strip ()),
101109 url_probe = url_probe ,
102110 check_method = check_method ,
111+ probe_method = probe_method ,
112+ probe_body = probe_body ,
103113 )
104114
105115
0 commit comments