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

Fix invalid URL on all requests #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Fabricio20
Copy link

This PR fixes an Invalid URL issue that is currently happening on Patreon-Java.

java.io.FileNotFoundException: https://www.patreon.com/api/oauth2/api//campaigns/123123/pledges?page%5Bcount%5D=15
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1915)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1515)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:251)
    at com.patreon.resources.RequestUtil.request(RequestUtil.java:26)
    at com.patreon.PatreonAPI.getDataStream(PatreonAPI.java:201)
    at com.patreon.PatreonAPI.fetchPageOfPledges(PatreonAPI.java:156)
    at com.patreon.PatreonAPI.fetchPageOfPledges(PatreonAPI.java:129)
    at com.patreon.PatreonAPI.fetchAllPledges(PatreonAPI.java:189)

This path issue has been present on Patreon-Java for a long time now but Patreon API never had issues with it, recently however, I started to receive a FileNotFound/404 on the URL because of that extra / in there.

@decmurphy
Copy link

decmurphy commented Feb 8, 2020

+1

This is happening to me now too since I've migrated from Java 8 to 11

Edit: Digging further, it looks like a more specific version of my earlier message would be to say that it works fine on httpclient-4.5.6 but is broken on httpclient-4.5.10 because of how URIBuilder works. Specifially, URIBuilder.buildString() stopped using a method normalizePath() which decided on whether or not to add a leading slash.

So this is not really something that can be changed in this repo since fixing it for some will break it for others. Repo needs to package up its dependencies.

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 this pull request may close these issues.

2 participants