Fixes subprotocol selection (aling with rfc6455)

This commit is contained in:
Konstantin Burkalev 2022-10-20 11:04:56 +03:00 committed by Canelo Hill
parent ce903f6d1d
commit cbe256209d
1 changed files with 2 additions and 2 deletions

View File

@ -101,8 +101,8 @@ func checkSameOrigin(r *http.Request) bool {
func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string {
if u.Subprotocols != nil {
clientProtocols := Subprotocols(r)
for _, serverProtocol := range u.Subprotocols {
for _, clientProtocol := range clientProtocols {
for _, clientProtocol := range clientProtocols {
for _, serverProtocol := range u.Subprotocols {
if clientProtocol == serverProtocol {
return clientProtocol
}