Skip to content

Commit

Permalink
v2.3.3 - revert back to string encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Lior Nabat committed Oct 21, 2022
1 parent a6e9531 commit 7f653a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: '3'

vars:
BINARY_NAME: kubemq
VERSION: v2.3.2
VERSION: v2.3.3

tasks:
check_update:
Expand All @@ -19,7 +19,7 @@ tasks:
- kubemq.exe server
goreleaser:
env:
VERSION: v2.3.2
VERSION: v2.3.3
cmds:
- goreleaser --snapshot --skip-publish --rm-dist
rundocker:
Expand Down
11 changes: 2 additions & 9 deletions services/api/actions/helpers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package actions

import (
"encoding/base64"
"encoding/json"
"fmt"
"reflect"
Expand All @@ -12,8 +11,7 @@ func detectAndConvertToBytesArray(data any) ([]byte, string, error) {
case []byte:
return data.([]byte), "[]Bytes", nil
case string:
enc := base64.StdEncoding.EncodeToString([]byte(data.(string)))
return []byte(enc), "string", nil
return []byte(data.(string)), "string", nil
case map[string]interface{}:
bytes, err := json.Marshal(data)
return bytes, "map[string]interface{}", err
Expand All @@ -37,10 +35,5 @@ func detectAndConvertToAny(data []byte) any {

return jsonArray
}
dec, err := base64.StdEncoding.DecodeString(string(data))
if err == nil {
return string(dec)
} else {
return data
}
return string(data)
}

0 comments on commit 7f653a9

Please sign in to comment.