mirror of https://github.com/gorilla/websocket.git
Fixes subprotocol selection (aling with rfc6455)
This commit is contained in:
parent
efaec3cbd1
commit
17f407278f
|
@ -101,8 +101,8 @@ func checkSameOrigin(r *http.Request) bool {
|
||||||
func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string {
|
func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string {
|
||||||
if u.Subprotocols != nil {
|
if u.Subprotocols != nil {
|
||||||
clientProtocols := Subprotocols(r)
|
clientProtocols := Subprotocols(r)
|
||||||
for _, serverProtocol := range u.Subprotocols {
|
for _, clientProtocol := range clientProtocols {
|
||||||
for _, clientProtocol := range clientProtocols {
|
for _, serverProtocol := range u.Subprotocols {
|
||||||
if clientProtocol == serverProtocol {
|
if clientProtocol == serverProtocol {
|
||||||
return clientProtocol
|
return clientProtocol
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue