File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ type AcceptOptions struct {
28
28
29
29
// InsecureSkipVerify is used to disable Accept's origin verification behaviour.
30
30
//
31
- // Deprecated: Use OriginPatterns with a match all pattern of * instead to control
32
- // origin authorization yourself.
31
+ // You probably want to use OriginPatterns instead.
33
32
InsecureSkipVerify bool
34
33
35
34
// OriginPatterns lists the host patterns for authorized origins.
@@ -46,6 +45,9 @@ type AcceptOptions struct {
46
45
//
47
46
// Please ensure you understand the ramifications of enabling this.
48
47
// If used incorrectly your WebSocket server will be open to CSRF attacks.
48
+ //
49
+ // Do not use * as a pattern to allow any origin, prefer to use InsecureSkipVerify instead
50
+ // to bring attention to the danger of such a setting.
49
51
OriginPatterns []string
50
52
51
53
// CompressionMode controls the compression mode.
Original file line number Diff line number Diff line change @@ -273,8 +273,8 @@ func TestWasm(t *testing.T) {
273
273
274
274
s := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
275
275
c , err := websocket .Accept (w , r , & websocket.AcceptOptions {
276
- Subprotocols : []string {"echo" },
277
- OriginPatterns : [] string { "*" } ,
276
+ Subprotocols : []string {"echo" },
277
+ InsecureSkipVerify : true ,
278
278
})
279
279
if err != nil {
280
280
t .Errorf ("echo server failed: %v" , err )
You can’t perform that action at this time.
0 commit comments