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

Getting redirect when fatching campaigns #40

Open
SirSkaro opened this issue Jul 17, 2021 · 2 comments · May be fixed by #41
Open

Getting redirect when fatching campaigns #40

SirSkaro opened this issue Jul 17, 2021 · 2 comments · May be fixed by #41

Comments

@SirSkaro
Copy link

When attempting to use the PatreonAPI#fetchCampaigns, I am getting the following response:

<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="http://www.patreon.com/oauth2/api/current_user/campaigns?include=rewards%2Ccreator%2Cgoals">http://www.patreon.com/oauth2/api/current_user/campaigns?include=rewards%2Ccreator%2Cgoals</a>.  If not click the link.

The library is initially trying to hit the url https://www.patreon.com/api/oauth2/api//current_user/campaigns?include=rewards%2Ccreator%2Cgoals. I haven't made changes to my client code in almost 3 years, so I'm assuming there was an API change?

@EtienneLamoureux
Copy link

EtienneLamoureux commented Jul 18, 2021

Same problem here: the library constructs paths with a faulty double-slash // after the /api part of the URL. Hitting the correct path manually without the double slash returns the expected result.

In my case, this segment of code created /campaigns/<campaign id>/pledges?page%5Bcount%5D=15 (notice the starting slash), which is then appended here to /api/oauth2/api/ (notice the trailing slash) and creates the problematic path containing // in the middle the URL. This results in the full final URL being https://www.patreon.com/api/oauth2/api//campaigns/<campaign id>/pledges?page%5Bcount%5D=15, which returns an HTML error page when called as-is.

@EtienneLamoureux
Copy link

EtienneLamoureux commented Jul 18, 2021

This would be fixed by #34 or the solution it suggests.

Edit: created a PR myself. See #41

EtienneLamoureux added a commit to EtienneLamoureux/patreon-java that referenced this issue Jul 18, 2021
EtienneLamoureux added a commit to EtienneLamoureux/patreon-java that referenced this issue Jul 18, 2021
@EtienneLamoureux EtienneLamoureux linked a pull request Jul 18, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants