link-preview-js
link-preview-js copied to clipboard
Follow multiple redirects (maybe with a configurable max)
It would be great if we could make the library follow multiple redirects. The issue we're encountering is that we try to generate a preview for a link that has 2 redirects on it First from HTTP to HTTPS and then a 'normal' redirect to another path.
Unfortunately we don't control the source of this link, so we cannot change it.
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
PRs are welcome
Maybe is possible if you set followRedirects: 'manual'
and then in handleRedirects
you count the number of redirects,
When your desired maximum redirects is reached, it should return a reject,
I haven't tested this yet, but it makes sense. I didn't had a way to test.
@george-i It seems like the library only allows 1 redirect to happen.
Back from a long vacation, looks like some of you are using the library in a paid product, would gladly implement this for you guys for a small fee/sponsorship.