Skip to content

Commit

Permalink
Consistently use the same OkHttpClient for files.slack.com calls (#1428)
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch authored Jan 28, 2025
1 parent 2094cf2 commit 0764bd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class FilesUploadV2Helper implements AutoCloseable {

public FilesUploadV2Helper(MethodsClient client) {
this.client = client;
this.okHttpClient = SlackHttpClient.buildOkHttpClient(client.getSlackHttpClient().getConfig());
this.okHttpClient = client.getSlackHttpClient().getOkHttpClient();
}

public String uploadFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public void setConfig(SlackConfig config) {
this.config = config;
}

public OkHttpClient getOkHttpClient() {
return this.okHttpClient;
}

public Response get(String url, Map<String, String> query, String token) throws IOException {
if (query != null) {
HttpUrl.Builder u = HttpUrl.parse(url).newBuilder();
Expand Down

0 comments on commit 0764bd8

Please sign in to comment.