Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

Commit 36a36f8

Browse files
committed
fix
1 parent 59c4b9d commit 36a36f8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ fun download(url: String, output: File) {
188188

189189
val githubToken = System.getenv("GITHUB_TOKEN")
190190
if (url.contains("github.com") && !githubToken.isNullOrEmpty()) {
191-
val connection = URL(url).openConnection()
191+
val connection = URL(url).openConnection() as java.net.HttpURLConnection
192192
connection.setRequestProperty("Authorization", "token $githubToken")
193193
connection.setRequestProperty("User-Agent", "Gradle-Build")
194-
Files.copy(connection.getInputStream(), output.toPath())
194+
connection.instanceFollowRedirects = true
195+
connection.connect()
196+
Files.copy(connection.inputStream, output.toPath())
195197
} else {
196198
Files.copy(URL(url).openStream(), output.toPath())
197199
}

0 commit comments

Comments
 (0)