From 7b8e15ff1d4e820d4c3a25a89392eb7708a06314 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 4 Mar 2021 18:27:48 -0500 Subject: [PATCH 1/2] replace (via modules) gorilla/websocket with our fork See #1584 --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 7cbd5be2..cdfadc7e 100644 --- a/go.mod +++ b/go.mod @@ -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 From f05c57344ec6538db8e69675dd0f176dea414205 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 4 Mar 2021 18:30:22 -0500 Subject: [PATCH 2/2] `go get` and commit the websocket fork --- go.sum | 2 ++ vendor/github.com/gorilla/websocket/server.go | 4 ++-- vendor/modules.txt | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.sum b/go.sum index bc668c8c..402f78e9 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/vendor/github.com/gorilla/websocket/server.go b/vendor/github.com/gorilla/websocket/server.go index 887d5589..8f6d422e 100644 --- a/vendor/github.com/gorilla/websocket/server.go +++ b/vendor/github.com/gorilla/websocket/server.go @@ -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 } diff --git a/vendor/modules.txt b/vendor/modules.txt index 9c0e9681..c4bd08cc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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