3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 10:42:52 +01:00

Merge pull request #1585 from slingamn/issue1584_websocket_preference.1

fix #1584
This commit is contained in:
Shivaram Lingamneni 2021-03-04 20:50:48 -05:00 committed by GitHub
commit 6fae02d335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

2
go.mod
View File

@ -23,3 +23,5 @@ require (
golang.org/x/text v0.3.4
gopkg.in/yaml.v2 v2.3.0
)
replace github.com/gorilla/websocket => github.com/oragono/websocket v1.4.2-oragono1

2
go.sum
View File

@ -52,6 +52,8 @@ github.com/oragono/confusables v0.0.0-20201108231250-4ab98ab61fb1 h1:Y87UllAzZJf
github.com/oragono/confusables v0.0.0-20201108231250-4ab98ab61fb1/go.mod h1:+uesPRay9e5tW6zhw4CJkRV3QOEbbZIJcsuo9ZnC+hE=
github.com/oragono/go-ident v0.0.0-20200511222032-830550b1d775 h1:AMAsAn/i4AgsmWQYdMoze9omwtHpbxrKuT+AT1LmhtI=
github.com/oragono/go-ident v0.0.0-20200511222032-830550b1d775/go.mod h1:r5Fk840a4eu3ii1kxGDNSJupQu9Z1UC1nfJOZZXC24c=
github.com/oragono/websocket v1.4.2-oragono1 h1:YcbddwFMNDTK+1pQfLq/HIvKe5NPLgl8NFefQUPJZCA=
github.com/oragono/websocket v1.4.2-oragono1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

View File

@ -99,8 +99,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
}

3
vendor/modules.txt vendored
View File

@ -18,7 +18,7 @@ github.com/docopt/docopt-go
github.com/go-sql-driver/mysql
# github.com/go-test/deep v1.0.6
## explicit
# github.com/gorilla/websocket v1.4.2
# github.com/gorilla/websocket v1.4.2 => github.com/oragono/websocket v1.4.2-oragono1
## explicit
github.com/gorilla/websocket
# github.com/goshuirc/irc-go v0.0.0-20210301225436-2c4b83d64847
@ -90,3 +90,4 @@ golang.org/x/text/width
# gopkg.in/yaml.v2 v2.3.0
## explicit
gopkg.in/yaml.v2
# github.com/gorilla/websocket => github.com/oragono/websocket v1.4.2-oragono1