Downgrade okhttp due to kotlin usage

This commit is contained in:
Vankka 2022-04-25 15:47:24 +03:00
parent 4a492a7392
commit d78450e291
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0
4 changed files with 10 additions and 2 deletions

View File

@ -11,9 +11,13 @@ dependencies {
exclude group: 'org.jetbrains', module: 'annotations' exclude group: 'org.jetbrains', module: 'annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305' exclude group: 'com.google.code.findbugs', module: 'jsr305'
// Downgrade okhttp (due to kotlin)
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
// We don't use audio // We don't use audio
exclude module: 'opus-java' exclude module: 'opus-java'
} }
api(libs.okhttp)
} }
// Relocations are in buildscript/api.gradle // Relocations are in buildscript/api.gradle

View File

@ -52,7 +52,7 @@ public class BinPasteService implements PasteService {
Request request = new Request.Builder() Request request = new Request.Builder()
.url(binUrl + "/v1/post") .url(binUrl + "/v1/post")
.post(RequestBody.create(json.toString(), MediaType.get("application/json"))) .post(RequestBody.create(MediaType.get("application/json"), json.toString()))
.build(); .build();
try (Response response = discordSRV.httpClient().newCall(request).execute()) { try (Response response = discordSRV.httpClient().newCall(request).execute()) {

View File

@ -39,7 +39,7 @@ public class BytebinPasteService implements PasteService {
Request request = new Request.Builder() Request request = new Request.Builder()
.url(bytebinUrl + "/post") .url(bytebinUrl + "/post")
.header("Content-Encoding", "gzip") .header("Content-Encoding", "gzip")
.post(RequestBody.create(fileContent, MediaType.get("application/octet-stream"))) .post(RequestBody.create(MediaType.get("application/octet-stream"), fileContent))
.build(); .build();
try (Response response = discordSRV.httpClient().newCall(request).execute()) { try (Response response = discordSRV.httpClient().newCall(request).execute()) {

View File

@ -53,6 +53,10 @@ dependencyResolutionManagement {
// JDA // JDA
library('jda', 'net.dv8tion', 'JDA').version('5.0.0-alpha.10') library('jda', 'net.dv8tion', 'JDA').version('5.0.0-alpha.10')
library('okhttp', 'com.squareup.okhttp3', 'okhttp').version {
prefer '3.12.13'
reject '[4,)' // Kotlin
}
// Discord Webhooks // Discord Webhooks
library('webhooks', 'club.minnced', 'discord-webhooks').version('0.8.0') library('webhooks', 'club.minnced', 'discord-webhooks').version('0.8.0')