Repository navigation
fix: return null when oEmbed response is missing html property - #78
SuparvaCode wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesoEmbed HTML validation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Missing-HTML oEmbed responses no longer cause a TypeError, and the caller treats them as absent. The regression fixture is included in generated tests; no actionable merge risk remains from this change. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches🧪 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. A rabbit checks the HTML string, Comment |
Resolves #20
Summary
When an oEmbed endpoint returns a JSON payload without an
htmlproperty (or wherehtmlis undefined),getOEmbedPlayercurrently throws aTypeError: Cannot read properties of undefined (reading 'startsWith'). This causessummalyto fail the preview request entirely instead of returningnullor falling back to OpenGraph player metadata.This PR checks that
typeof body.html === 'string'before inspectingstartsWith/endsWith, and adds an invalid oEmbed test fixture (oembed-no-html.json) to regression test the behavior.(Apologies for writing in English - my Japanese is limited so I used a live translator to follow the issue description!)