Skip to content

Commit

Permalink
ArtemisStompClient: Update decompression (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
anian03 authored Jan 20, 2025
1 parent 23fa0aa commit af65925
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/APIClient/StompClient/ArtemisStompClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ extension ArtemisStompClient: SwiftStompDelegate {
log.debug("Stomp: MessageReceived")
let continuation = continuations[destination]

if headers["compressed"] == "true" {
if let unzipped = try? (message as? Data)?.gunzipped() {
if headers["X-Compressed"] == "true" {
if let message = message as? String,
let unzipped = try? Data(base64Encoded: message)?.gunzipped() {
continuation?.yield(unzipped)
} else {
log.warning("Stomp: Failed to gunzip compressed message")
Expand Down

0 comments on commit af65925

Please sign in to comment.