Skip to content

Commit

Permalink
Fix setting client in UploadLogResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed Apr 8, 2024
1 parent 0e4404c commit 7d33ff7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This project is available from Maven Central, so you just need to add the depend
#### Gradle
```gradle
dependencies {
implementation 'gs.mclo:api:4.0.0'
implementation 'gs.mclo:api:4.0.2'
}
```

Expand All @@ -20,7 +20,7 @@ dependencies {
<dependency>
<groupId>gs.mclo</groupId>
<artifactId>api</artifactId>
<version>4.0.0</version>
<version>4.0.2</version>
</dependency>
```

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/gs/mclo/api/MclogsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ public CompletableFuture<UploadLogResponse> uploadLog(Log log) {
.header("User-Agent", this.getUserAgent())
.POST(HttpRequest.BodyPublishers.ofString("content=" + URLEncoder.encode(log.getContent(), StandardCharsets.UTF_8)))
.build();
return httpClient.sendAsync(request, Util.parseResponse(UploadLogResponse.class, gson)).thenApply(HttpResponse::body);
return httpClient.sendAsync(request, Util.parseResponse(UploadLogResponse.class, gson))
.thenApply(HttpResponse::body)
.thenApply(r -> r.setClient(this));
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/java/gs/mclo/api/response/UploadLogResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import gs.mclo.api.MclogsClient;

import java.io.IOException;
import java.util.concurrent.CompletableFuture;

public class UploadLogResponse extends JsonResponse {
Expand Down

0 comments on commit 7d33ff7

Please sign in to comment.