diff --git a/src/main/java/org/kohsuke/github/GHHooks.java b/src/main/java/org/kohsuke/github/GHHooks.java index 1a6154aa6d..4ee939c5a8 100644 --- a/src/main/java/org/kohsuke/github/GHHooks.java +++ b/src/main/java/org/kohsuke/github/GHHooks.java @@ -21,8 +21,9 @@ private Context(GitHub root) { } public List getHooks() throws IOException { - List list = new ArrayList(Arrays.asList( - root.retrieve().to(collection(), collectionClass()))); + + GHHook [] hookArray = root.retrieve().to(collection(),collectionClass()); // jdk/eclipse bug requires this to be on separate line + List list = new ArrayList(Arrays.asList(hookArray)); for (GHHook h : list) wrap(h); return list; diff --git a/src/main/java/org/kohsuke/github/Requester.java b/src/main/java/org/kohsuke/github/Requester.java index b8b53b78cd..92f069bdfe 100644 --- a/src/main/java/org/kohsuke/github/Requester.java +++ b/src/main/java/org/kohsuke/github/Requester.java @@ -273,8 +273,12 @@ public InputStream asStream(String tailApiUrl) throws IOException { while (true) {// loop while API rate limit is hit setupConnection(root.getApiURL(tailApiUrl)); - buildRequest(); - + + // if the download link is encoded with a token on the query string, the default behavior of POST will fail + uc.setRequestMethod("GET"); + + buildRequest(); + try { return wrapStream(uc.getInputStream()); } catch (IOException e) {