Skip to content

Commit

Permalink
Merge pull request #13 from olegromanchuk/fix/errmsg-upgrader-origin
Browse files Browse the repository at this point in the history
Fix error message reference and allow all origins in WebSocket upgrader
  • Loading branch information
davidvonthenen authored Aug 21, 2024
2 parents e779c67 + fb6bf72 commit ccb024f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import (
var upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
// Allow all origins
CheckOrigin: func(r *http.Request) bool {
return true
},
}

type WebSocketMessage struct {
Expand Down Expand Up @@ -76,7 +80,7 @@ func (c MyCallback) UtteranceEnd(ur *api.UtteranceEndResponse) error {
func (c MyCallback) Error(er *api.ErrorResponse) error {
fmt.Printf("\n[Error] Received\n")
fmt.Printf("Error.Type: %s\n", er.Type)
fmt.Printf("Error.Message: %s\n", er.Message)
fmt.Printf("Error.Message: %s\n", er.ErrMsg)
fmt.Printf("Error.Description: %s\n\n", er.Description)
return nil
}
Expand Down

0 comments on commit ccb024f

Please sign in to comment.