Skip to content

Commit d0392ba

Browse files
authored
Use correct HTTP method for redirects (#101)
Instead of hardcoding POST, let's use the original method when following redirects. This fixes deleting commit comments (and other calls potentially). We'll add tests for this in a follow-up since it requires a non-trivial amount of setup to test properly and we need to ship this fix ASAP. Sorry.
1 parent cb8ed95 commit d0392ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/spotify/github/v3/clients/GitHubClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ CompletableFuture<Response> processPossibleRedirects(
772772
final Request request =
773773
requestBuilder(newLocation)
774774
.url(newLocation)
775-
.method("POST", response.request().body())
775+
.method(response.request().method(), response.request().body())
776776
.build();
777777
// Do the new call and complete the original future when the new call completes
778778
return call(request);

0 commit comments

Comments
 (0)