fix(install): detect curl version before using --ssl-revoke-best-effort#1116
fix(install): detect curl version before using --ssl-revoke-best-effort#1116Ellien-Tang wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR fixes an issue where curl installations on older Windows systems fail because they don't support the ChangesWindows curl flag compatibility
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for the contribution, @Ellien-Tang! The change looks good. The only thing blocking the merge is the CLA — please sign it here: https://cla-assistant.io/larksuite/cli?pullRequest=1116 and the check will turn green automatically. 🙏 |
|
Thanks a lot for catching and fixing this, @Ellien-Tang! Your fix has been merged via #1124 with your original commit and authorship preserved. On top of it I added a small testability refactor (extracted the version comparison into a pure Closing this one as superseded by #1124. Really appreciate the contribution — looking forward to more! |
Problem
On older Windows systems (e.g., Windows 10 build 19044 with curl 7.55.1), the npm installation fails because the
--ssl-revoke-best-effortflag is unconditionally added on Windows, but this flag was only introduced in curl 7.70.0 (2020-04-29).Error message:
Related Issue: Fixes #1099
Solution
Add a
curlSupportsSslRevokeBestEffort()helper that:curl --versionto get the installed versiontrueonly when curl >= 7.70.0The
download()function now checks bothisWindowsANDcurlSupportsSslRevokeBestEffort()before adding the flag. Older curl versions gracefully fall back to standard SSL revocation checks.Changes
curlSupportsSslRevokeBestEffort()function with version parsing logicdownload()fromif (isWindows)toif (isWindows && curlSupportsSslRevokeBestEffort())Backward Compatibility
--ssl-revoke-best-effortis still used to avoidCRYPT_E_REVOCATION_OFFLINEerrorsTest Coverage
The version parsing correctly handles:
false- flag not usedfalse- flag not usedtrue- flag usedtrue- flag usedSummary by CodeRabbit