Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Undeprecate InsecureSkipVerify#225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nhooyr merged 3 commits intodevfromundep
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Undeprecate InsecureSkipVerify
It's more clear than * as an origin pattern.
  • Loading branch information
@nhooyr
nhooyr committedApr 15, 2020
commitf074be25a16fb07b08f48fefac19a294130caad8
6 changes: 4 additions & 2 deletionsaccept.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,8 +28,7 @@ type AcceptOptions struct {

// InsecureSkipVerify is used to disable Accept's origin verification behaviour.
//
// Deprecated: Use OriginPatterns with a match all pattern of * instead to control
// origin authorization yourself.
// You probably want to use OriginPatterns instead.
InsecureSkipVerify bool

// OriginPatterns lists the host patterns for authorized origins.
Expand All@@ -46,6 +45,9 @@ type AcceptOptions struct {
//
// Please ensure you understand the ramifications of enabling this.
// If used incorrectly your WebSocket server will be open to CSRF attacks.
//
// Do not use * as a pattern to allow any origin, prefer to use InsecureSkipVerify instead
// to bring attention to the danger of such a setting.
OriginPatterns []string

// CompressionMode controls the compression mode.
Expand Down
4 changes: 2 additions & 2 deletionsconn_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -273,8 +273,8 @@ func TestWasm(t *testing.T) {

s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
c, err := websocket.Accept(w, r, &websocket.AcceptOptions{
Subprotocols: []string{"echo"},
OriginPatterns: []string{"*"},
Subprotocols:[]string{"echo"},
InsecureSkipVerify: true,
})
if err != nil {
t.Errorf("echo server failed: %v", err)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp