Compare commits

..

1 commit

Author SHA1 Message Date
e5cf6d291a
NOTICKET: Setup and Sepcify Websocket Structure
Some checks failed
Quality Check / Validate OAS (pull_request) Successful in 36s
Quality Check / Validate OAS (push) Successful in 39s
Quality Check / Static Analysis (push) Failing after 1m7s
Quality Check / Linting (push) Successful in 1m16s
Quality Check / Testing (push) Successful in 1m17s
Quality Check / Static Analysis (pull_request) Failing after 58s
Quality Check / Linting (pull_request) Successful in 1m0s
Quality Check / Testing (pull_request) Successful in 44s
2025-02-17 10:43:52 +01:00
3 changed files with 5 additions and 6 deletions

View file

@ -22,11 +22,12 @@ public class ConnectionWebsocketHandler extends JsonWebsocketHandler {
protected void handleTextMessage(WebSocketSession session, TextMessage message) {
try{
String payload = message.getPayload();
switch ( objectMapper.readTree(payload).get("$id").asText()) {
case RequestConnectionTokenMessage.MESSAGE_ID -> handleRequestConnectionToken(session, payload);
switch ( objectMapper.readTree(payload).get("$id").asText().toLowerCase()) {
case "requestconnectiontoken" -> handleRequestConnectionToken(session, payload);
default -> this.closeSession(session, CloseStatus.BAD_DATA);
}
} catch (Exception ignored) {
} catch (Exception exception) {
System.out.println(exception.getMessage());
this.closeSession(session, CloseStatus.BAD_DATA);
}
}

View file

@ -8,8 +8,6 @@ import lombok.*;
@Data
@NotNull
public class RequestConnectionTokenMessage {
public static final String MESSAGE_ID = "RequestConnectionToken";
@JsonProperty("$id")
private String messageId;
private Channel channel;

View file

@ -7,7 +7,7 @@ info:
Because of the limitations of Async API, we expect that the actual json,
which is send as payload to always contain a field called `$id` with
the corresponding `messageId`. <br>
The `messageId` should be handled case sensitive.
The `messageId` should be handled case insensitive.
defaultContentType: application/json
servers:
localhost: