File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import (
11
11
"net"
12
12
"net/http"
13
13
"net/http/httptest"
14
- "strings"
15
14
"sync"
16
15
"testing"
17
16
"time"
@@ -212,7 +211,7 @@ func TestPing(t *testing.T) {
212
211
}
213
212
}
214
213
215
- func TestHTTP2WebSocketFallback (t * testing.T ) {
214
+ func TestHTTP2OnlyServer (t * testing.T ) {
216
215
serverPrivateKey := key .NewNode ()
217
216
s := derp .NewServer (serverPrivateKey , t .Logf )
218
217
defer s .Close ()
@@ -257,23 +256,9 @@ func TestHTTP2WebSocketFallback(t *testing.T) {
257
256
RootCAs : httpsrv .Client ().Transport .(* http.Transport ).TLSClientConfig .RootCAs ,
258
257
}
259
258
defer c .Close ()
260
- reasonCh := make (chan string , 1 )
261
- c .SetForcedWebsocketCallback (func (region int , reason string ) {
262
- select {
263
- case reasonCh <- reason :
264
- default :
265
- }
266
- })
259
+
267
260
err = c .Connect (context .Background ())
268
- if err == nil {
269
- // Expect an error!
270
- t .Fatal ("client didn't error on initial connect" )
271
- }
272
- reason := <- reasonCh
273
- if ! strings .Contains (reason , "DERP requires Upgrade which needs" ) {
274
- t .Fatalf ("reason doesn't contain message: %s" , reason )
275
- }
276
- if err := c .Connect (context .Background ()); err != nil {
277
- t .Fatalf ("client Connect: %v" , err )
261
+ if err != nil {
262
+ t .Fatalf ("client errored initial connect: %v" , err )
278
263
}
279
264
}
You can’t perform that action at this time.
0 commit comments