Skip to content

Commit

Permalink
test: Fix lint - ignore G114
Browse files Browse the repository at this point in the history
  • Loading branch information
dudong2 committed Jul 5, 2024
1 parent 849ec74 commit d20e83b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rpc/websockets.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ func (s *websocketsServer) Start() {

go func() {
var err error
/* #nosec G114 -- http functions have no support for timeouts */
if s.certFile == "" || s.keyFile == "" {
err = http.ListenAndServe(s.wsAddr, ws)
err = http.ListenAndServe(s.wsAddr, ws) // #nosec G114

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: go.lang.security.audit.net.use-tls.use-tls Warning

Found an HTTP server without TLS. Use 'http.ListenAndServeTLS' instead. See https://golang.org/pkg/net/http/#ListenAndServeTLS for more information.
} else {
err = http.ListenAndServeTLS(s.wsAddr, s.certFile, s.keyFile, ws)
err = http.ListenAndServeTLS(s.wsAddr, s.certFile, s.keyFile, ws) // #nosec G114
}

if err != nil {
Expand Down

0 comments on commit d20e83b

Please sign in to comment.