fix(cube-cli): default to https:// for scheme-less Cube Cloud URLs - #11335
Conversation
Entering a URL like cloud.cubecloud.dev at the `cube login` prompt (or via --api-url/CUBE_API_URL or a saved context) failed with reqwest's "builder error: relative URL without a base". Normalize user-supplied URLs by prepending https:// when no scheme is present. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLCPy9xaxFgSdH7fPMMLwX
|
Claude finished @paveltiunov's task in 39s —— View job Code Review — PR #11335Verdict: LGTM — small, focused fix. Nothing blocking; a couple of minor observations below. Details
What the PR does well
Minor observations (non-blocking)
Security / performanceNothing to flag. Pure string manipulation, no allocations of concern, no auth logic changed. |
Check List
Description of Changes Made (if issue reference is not provided)
Entering a Cube Cloud URL without a scheme (e.g.
cloud.cubecloud.dev) at thecube loginprompt — or via--api-url/CUBE_API_URL/ a saved context — failed with reqwest'serror: builder error: relative URL without a base.normalize_urlhelper insrc/util.rsthat trims whitespace and trailing slashes and prependshttps://when no scheme is present (explicit schemes likehttp://localhost:4000are left untouched).cube loginprompt /--urlflag, and inCtx::api()so--api-url,CUBE_API_URL, and contexts saved with a scheme-less URL are normalized too.cargo test,cargo clippy, andcargo fmt --checkpass inrust/cube-cli.🤖 Generated with Claude Code
https://claude.ai/code/session_01JLCPy9xaxFgSdH7fPMMLwX
Generated by Claude Code