release: prepare production client deployment
This commit is contained in:
@@ -32,8 +32,9 @@ def discover_routes(
|
||||
if not isinstance(api_path, str):
|
||||
continue
|
||||
try:
|
||||
local_path = roots.api_to_local(api_path)
|
||||
relative = PurePosixPath(api_path).relative_to(roots.api_root)
|
||||
normalized_api_path = _normalize_api_path(api_path, roots)
|
||||
local_path = roots.api_to_local(normalized_api_path)
|
||||
relative = normalized_api_path.relative_to(roots.api_root)
|
||||
except (ConfigError, ValueError):
|
||||
continue
|
||||
if not _lexically_within(local_path, roots.local_root):
|
||||
@@ -93,3 +94,14 @@ def _lexically_within(path: Path, root: Path) -> bool:
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
def _normalize_api_path(
|
||||
api_path: str, roots: RootMapping
|
||||
) -> PurePosixPath:
|
||||
"""Resolve Syncthing's home-relative folder notation under api_root."""
|
||||
|
||||
candidate = PurePosixPath(api_path)
|
||||
if candidate.parts and candidate.parts[0] == "~":
|
||||
candidate = roots.api_root.joinpath(*candidate.parts[1:])
|
||||
return candidate
|
||||
|
||||
@@ -159,7 +159,7 @@ def _supported_qb_version(version: str) -> bool:
|
||||
if match is None:
|
||||
return False
|
||||
major, minor = int(match.group(1)), int(match.group(2))
|
||||
return major == 5 or (major == 4 and minor in {5, 6})
|
||||
return major == 5 or (major == 4 and minor in {4, 5, 6})
|
||||
|
||||
|
||||
def _text_get(
|
||||
|
||||
Reference in New Issue
Block a user