wscat: check upgrade error.
This commit is contained in:
parent
75cb0a68fc
commit
ad2695a092
1 changed files with 1 additions and 5 deletions
|
@ -4,7 +4,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"os"
|
"os"
|
||||||
|
@ -96,10 +95,7 @@ func TestWScat(t *testing.T) {
|
||||||
var received, sent [][]byte
|
var received, sent [][]byte
|
||||||
h := func(w http.ResponseWriter, r *http.Request) {
|
h := func(w http.ResponseWriter, r *http.Request) {
|
||||||
c, err := upgrader.Upgrade(w, r, nil)
|
c, err := upgrader.Upgrade(w, r, nil)
|
||||||
if err != nil {
|
require.NoError(t, err)
|
||||||
log.Print("upgrade:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer func() { _ = c.Close() }()
|
defer func() { _ = c.Close() }()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in a new issue