Skip to content

Commit

Permalink
Fixes subprotocol selection (aling with rfc6455)
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon authored and jaitaiwan committed Jun 19, 2024
1 parent efaec3c commit 17f4072
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 17f4072

Please # to comment.