Skip to content

Commit 4c85b8b

Browse files
authored
Merge pull request #139 from shelltime/fix/encrypted-mode-base64-encoding
fix(daemon): base64 encode encrypted track data for JSON transport
2 parents a30e94b + 6ecf465 commit 4c85b8b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

daemon/handlers.sync.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package daemon
22

33
import (
44
"context"
5+
"encoding/base64"
56
"encoding/json"
67
"log/slog"
78
"time"
@@ -79,9 +80,9 @@ func handlePubSubSync(ctx context.Context, socketMsgPayload interface{}) error {
7980
}
8081

8182
realPayload = model.PostTrackArgs{
82-
Encrypted: string(encryptedData),
83-
AesKey: string(encodedKey),
84-
Nonce: string(nonce),
83+
Encrypted: base64.StdEncoding.EncodeToString(encryptedData),
84+
AesKey: base64.StdEncoding.EncodeToString(encodedKey),
85+
Nonce: base64.StdEncoding.EncodeToString(nonce),
8586
}
8687
}
8788
}

0 commit comments

Comments
 (0)