Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow multiple redirects (maybe with a configurable max) #135

Open
wouterlemcke opened this issue Sep 8, 2022 · 4 comments
Open

Follow multiple redirects (maybe with a configurable max) #135

wouterlemcke opened this issue Sep 8, 2022 · 4 comments

Comments

@wouterlemcke
Copy link

wouterlemcke commented Sep 8, 2022

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.
Fund with Polar
@ospfranco
Copy link
Collaborator

PRs are welcome

@george-i
Copy link

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.

@edymusajev
Copy link

@george-i It seems like the library only allows 1 redirect to happen.

@ospfranco
Copy link
Collaborator

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.

@polar-sh polar-sh bot added the Fund label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants