Skip to content

Commit

Permalink
Merge pull request #5 from KSDaemon/master
Browse files Browse the repository at this point in the history
Fixes subprotocol selection (aling with rfc6455) fixes #4
  • Loading branch information
tebruno99 authored Dec 13, 2022
2 parents 76ecc29 + 6c4aed8 commit 9bafdcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9bafdcc

Please sign in to comment.