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 dbc79f8

Browse filesBrowse files
committed
Fixing issue raised in hub4j#247
From Shredder121, -------------------- Only the HttpURLConnection.method was set by that change. Not the Requester.method. This means that Requester.method is still set to POST, isMethodWithBody will return true, and uc.setDoOutput(true) will be called. I use Okhttp, and their HttpURLConnectionImpl's method changes to POST if you tell it to open a stream to write to.
1 parent 54c3070 commit dbc79f8
Copy full SHA for dbc79f8

File tree

Expand file treeCollapse file tree

1 file changed

+3
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-6
lines changed

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/Requester.java
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,9 @@ private <T> T _to(String tailApiUrl, Class<T> type, T instance) throws IOExcepti
264264
*/
265265
public int asHttpStatusCode(String tailApiUrl) throws IOException {
266266
while (true) {// loop while API rate limit is hit
267+
method("GET");
267268
setupConnection(root.getApiURL(tailApiUrl));
268269

269-
uc.setRequestMethod("GET");
270-
271270
buildRequest();
272271

273272
try {
@@ -280,12 +279,10 @@ public int asHttpStatusCode(String tailApiUrl) throws IOException {
280279

281280
public InputStream asStream(String tailApiUrl) throws IOException {
282281
while (true) {// loop while API rate limit is hit
282+
method("GET"); // if the download link is encoded with a token on the query string, the default behavior of POST will fail
283283
setupConnection(root.getApiURL(tailApiUrl));
284284

285-
// if the download link is encoded with a token on the query string, the default behavior of POST will fail
286-
uc.setRequestMethod("GET");
287-
288-
buildRequest();
285+
buildRequest();
289286

290287
try {
291288
return wrapStream(uc.getInputStream());

0 commit comments

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