Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Accept() docs #235

Closed
jordipainan opened this issue May 7, 2020 · 3 comments
Closed

Update Accept() docs #235

jordipainan opened this issue May 7, 2020 · 3 comments
Labels

Comments

@jordipainan
Copy link

jordipainan commented May 7, 2020

// Accept will not allow cross origin requests by default.
// See the InsecureSkipVerify option to allow cross origin requests.
//
// Accept will write a response to w on all errors.
func Accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (*Conn, error) {
	return accept(w, r, opts)
}

InsecureSkipVerify is deprecated as mentioned in docs. When you see it is deprecated you end up in AcceptOptions{OriginPatterns: []string{x}}.

I suggest to change the code snippet mentioned above by:

// Accept will not allow cross origin requests by default.
// See the OriginPatterns option to allow cross origin requests.
//
// Accept will write a response to w on all errors.
func Accept(w http.ResponseWriter, r *http.Request, opts *AcceptOptions) (*Conn, error) {
	return accept(w, r, opts)
}
@jordipainan
Copy link
Author

jordipainan commented May 7, 2020

BTW: I love this library :), I used gorilla

@nhooyr
Copy link
Contributor

nhooyr commented May 7, 2020

Great point. #225 will help with this.

@nhooyr nhooyr added the docs label May 7, 2020
@nhooyr
Copy link
Contributor

nhooyr commented May 7, 2020

BTW: I love this library :), I used gorilla

Thank you <3

@nhooyr nhooyr closed this as completed in 2a1e717 May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants