fix: use configured base URL for QR login (all SDKs) - #83
Conversation
QR code fetch and status polling previously always hit ilinkai.weixin.qq.com even when BotOptions.baseUrl pointed at a local proxy hub (e.g. iLink Hub). Message APIs already respected baseUrl; this aligns the login path for hub pairing and custom gateways. Affected: Rust, Go, Node.js, Python SDKs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Conclusion: Approve Overall assessment: A clean, well-scoped bug fix. The QR-login path ( Review scope: Reviewed the full diff plus the surrounding base-URL resolution in each SDK's login module to confirm the configured value is sourced correctly and no hardcoded fallback remains: What looks good:
Must fix: None. Should improve: None. Optional: Consider a small regression test that asserts Questions: None. Testing / Risk: Low risk. Pure substitution of an already-resolved configured value for a literal that, by default, equals the same string — so default behavior is unchanged and the proxy-hub case is now supported. No CI checks are configured on this repo/branch ( Next step: Approve and merge. Optionally run the two manual test-plan checks against a mock hub first. |
Summary
QR login (
get_bot_qrcode/get_qrcode_status) previously always calledhttps://ilinkai.weixin.qq.com, ignoringBotOptions.baseUrl/Options.BaseURL/options.baseUrl/base_url.Message APIs already respected the configured base URL. This change aligns the login path so clients can pair through local proxy hubs (e.g. iLink Hub) by only setting
WEIXIN_BASE_URL.Changes
rust/src/bot.rsgolang/internal/auth/login.gonodejs/src/auth/authenticator.tspython/wechatbot/auth.pyIDC redirect (
scaned_but_redirect) behavior is unchanged — polling may still switch toredirect_hostwhen returned by Tencent.Test plan
cargo testinrust/(46 tests pass)baseUrlat a mock hub; verifyget_bot_qrcodehits the mock, not TencentbaseUrlis omitted (stillilinkai.weixin.qq.com)Made with Cursor