File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ type AcceptOptions struct {
2828
2929 // InsecureSkipVerify is used to disable Accept's origin verification behaviour.
3030 //
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.
3332 InsecureSkipVerify bool
3433
3534 // OriginPatterns lists the host patterns for authorized origins.
@@ -46,6 +45,9 @@ type AcceptOptions struct {
4645 //
4746 // Please ensure you understand the ramifications of enabling this.
4847 // 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.
4951 OriginPatterns []string
5052
5153 // CompressionMode controls the compression mode.
Original file line number Diff line number Diff line change @@ -273,8 +273,8 @@ func TestWasm(t *testing.T) {
273273
274274 s := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
275275 c , err := websocket .Accept (w , r , & websocket.AcceptOptions {
276- Subprotocols : []string {"echo" },
277- OriginPatterns : [] string { "*" } ,
276+ Subprotocols : []string {"echo" },
277+ InsecureSkipVerify : true ,
278278 })
279279 if err != nil {
280280 t .Errorf ("echo server failed: %v" , err )
You can’t perform that action at this time.
0 commit comments