Skip to content

Commit

Permalink
📦 create release v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
k33g committed Sep 9, 2023
1 parent eb61737 commit ce969a4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion slingshot-server/cmds/listen-start.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmds

import (
"encoding/base64"
"encoding/json"
"fmt"
"log"
Expand Down Expand Up @@ -81,8 +82,15 @@ func Start(wasmFilePath string, wasmFunctionName string, httpPort string) {
c.Set(key, value)
}
if len(httpResponse.TextBody) > 0 {
return c.SendString(httpResponse.TextBody)
// test encoding of TextBody
decodedStrAsByteSlice, err := base64.StdEncoding.DecodeString(string(httpResponse.TextBody))
if err != nil {
return c.SendString(httpResponse.TextBody)
}
//return c.SendString(httpResponse.TextBody)
return c.SendString(string(decodedStrAsByteSlice))
}

// send JSON body
jsonBody, err := json.Marshal(httpResponse.JsonBody)
if err != nil {
Expand Down

0 comments on commit ce969a4

Please sign in to comment.