Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f9291f9

Browse filesBrowse files
committed
Merge pull request hub4j#216 from if6was9/issue-215-download-failure
hub4j#215 fix read() failure with private repos
2 parents c3b4ee9 + b0687db commit f9291f9
Copy full SHA for f9291f9

File tree

Expand file treeCollapse file tree

2 files changed

+9
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-4
lines changed

‎src/main/java/org/kohsuke/github/GHHooks.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHHooks.java
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ private Context(GitHub root) {
2121
}
2222

2323
public List<GHHook> getHooks() throws IOException {
24-
List<GHHook> list = new ArrayList<GHHook>(Arrays.asList(
25-
root.retrieve().to(collection(), collectionClass())));
24+
25+
GHHook [] hookArray = root.retrieve().to(collection(),collectionClass()); // jdk/eclipse bug requires this to be on separate line
26+
List<GHHook> list = new ArrayList<GHHook>(Arrays.asList(hookArray));
2627
for (GHHook h : list)
2728
wrap(h);
2829
return list;

‎src/main/java/org/kohsuke/github/Requester.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/Requester.java
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,12 @@ public InputStream asStream(String tailApiUrl) throws IOException {
273273
while (true) {// loop while API rate limit is hit
274274
setupConnection(root.getApiURL(tailApiUrl));
275275

276-
buildRequest();
277-
276+
277+
// if the download link is encoded with a token on the query string, the default behavior of POST will fail
278+
uc.setRequestMethod("GET");
279+
280+
buildRequest();
281+
278282
try {
279283
return wrapStream(uc.getInputStream());
280284
} catch (IOException e) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.