Skip to content

Commit a7c1b9c

Browse files
committed
Fix e2e regression where CLI sent empty query param (workspace=) when flag is not provided
Signed-off-by: lelia <lelia@socket.dev>
1 parent 4fc120b commit a7c1b9c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

socketsecurity/socketcli.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424

2525
load_dotenv()
2626

27+
def _normalize_workspace(workspace):
28+
"""Return None for unset/blank workspace values so SDK omits query param."""
29+
if workspace is None:
30+
return None
31+
if isinstance(workspace, str):
32+
normalized = workspace.strip()
33+
return normalized or None
34+
return workspace
35+
2736
def cli():
2837
try:
2938
main_code()
@@ -465,7 +474,7 @@ def main_code():
465474
set_as_pending_head=is_default_branch,
466475
tmp=False,
467476
scan_type='socket_tier1' if config.reach else 'socket',
468-
workspace=config.workspace or "",
477+
workspace=_normalize_workspace(config.workspace),
469478
)
470479

471480
params.include_license_details = not config.exclude_license_details

0 commit comments

Comments
 (0)