Allowed localhost when making requests - #878
Conversation
ref TryGhost/Ghost#28978 (review) Post scheduling is broken in development because we use a `localhost` URL. `@tryghost/request` doesn't consider `localhost` URLs valid, so scheduling is broken. This fixes that by allowing `localhost` URLs. I was a little nervous about loosening the validation, but it's code could make requests to `localhost` before this change. (I considered an alternative where Ghost development used `127.0.0.1` instead, which also fixes the problem, but that's too disruptive to development IMO.)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe request URL validation now requires a string and accepts URLs supported by the default validator or localhost hosts. Tests cover overlong URLs, URLs with spaces or angle brackets, and successful requests to Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #878 +/- ##
==========================================
- Coverage 97.79% 96.80% -0.99%
==========================================
Files 105 14 -91
Lines 3405 658 -2747
Branches 604 116 -488
==========================================
- Hits 3330 637 -2693
+ Misses 24 8 -16
+ Partials 51 13 -38 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Just a heads up that I likely won't have time to review this today. Happy to take a look tomorrow/Thursday. I don't think it's urgent, but let me know if you disagree. |
|
Yeah, not urgent at all. No rush. |
ref TryGhost/Ghost#28978 (review)
Post scheduling is broken in development because we use a
localhostURL.@tryghost/requestdoesn't considerlocalhostURLs valid, so scheduling is broken.This fixes that by allowing
localhostURLs.I was a little nervous about loosening the validation, but it's code could make requests to
localhostbefore this change.(I considered an alternative where Ghost development used
127.0.0.1instead, which also fixes the problem, but that's too disruptive to development IMO.)