Skip to content

Commit

Permalink
Respect Mattermost websocket subpath URLs (#1040)
Browse files Browse the repository at this point in the history
Whenever a subpath is passed on the Mattermost.URL, we should use the
same path for its websocket connection string.

Signed-off-by: Marcelo Mello <[email protected]>
  • Loading branch information
tchellomello committed Apr 13, 2023
1 parent a69f7cf commit bd64d77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/bot/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ func NewMattermost(log logrus.FieldLogger, commGroupName string, cfg config.Matt
}

// Create WebSocketClient and handle messages
webSocketURL := WebSocketProtocol + checkURL.Host
webSocketURL := WebSocketProtocol + checkURL.Host + checkURL.Path
if checkURL.Scheme == httpsScheme {
webSocketURL = WebSocketSecureProtocol + checkURL.Host
webSocketURL = WebSocketSecureProtocol + checkURL.Host + checkURL.Path
}

client := model.NewAPIv4Client(cfg.URL)
Expand Down

0 comments on commit bd64d77

Please sign in to comment.