Skip to main content
在 Manus 中运行任何 Skill
一键导入

url-userinfo-string-construction-stacks-on-reauth

星标2
分支0
更新时间2026年6月18日 00:45

Embedding an OAuth/PAT token into an `https://user:pass@host/...` URL via f-string concatenation (`f"https://x-access-token:{token}@{rest}"`) breaks under TWO recurring conditions — (1) the token contains URL-reserved chars (`:` `/` `@` `?` `#` `%`) which the URL parser misreads, and (2) a re-auth on the same checkout (clone-time set-url + a later push-time set-url) STACKS userinfo segments into `user:pass@user:pass@host`. A naive `split("@", 1)` only collapses ONE stack; production needs `rsplit("@", 1)` (or `urllib.parse.urlsplit` + explicit netloc rewrite). Same fix shape across git push, docker registry login, MQTT URIs.

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

SKILL.md
readonly