Skip to content

Commit

Permalink
add exceptions, change client version
Browse files Browse the repository at this point in the history
  • Loading branch information
kocherovv committed Oct 18, 2023
1 parent 0221675 commit f248474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.green-api</groupId>
<artifactId>whatsapp-api-webhook-server-java</artifactId>
<version>0.0.1</version>
<version>0.0.2</version>
<name>whatsapp-api-webhook-server-java</name>
<description>whatsapp-api-webhook-server-java</description>
<licenses>
Expand All @@ -34,7 +34,7 @@
</developers>
<properties>
<java.version>17</java.version>
<whatsapp-api-client-java.version>0.0.6</whatsapp-api-client-java.version>
<whatsapp-api-client-java.version>0.0.7</whatsapp-api-client-java.version>
</properties>
<distributionManagement>
<snapshotRepository>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/greenapi/server/pkg/WebhookServer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.greenapi.server.pkg;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.greenapi.client.pkg.api.exceptions.GreenApiClientException;
import com.greenapi.client.pkg.api.webhook.NotificationMapper;
import com.greenapi.client.pkg.api.webhook.WebhookHandler;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -28,7 +29,7 @@ public void receiveAsyncWebhook(@RequestBody String jsonString,
@RequestHeader(required = false) String Authorization) {
if (Authorization != null &&
!Authorization.replaceAll("Bearer ", "").equals(webhookToken)) {
log.info("request with invalid webhookToken");
throw new GreenApiClientException("Invalid webhookToken - request is ignored");

} else {
CompletableFuture.runAsync(() -> {
Expand Down

0 comments on commit f248474

Please sign in to comment.