mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 12:23:01 -06:00
[bugfix] send back Sec-Websocket-Protocol header for streaming WebSocket (#3169)
* [bugfix] send back Sec-Websocket-Protocol header for streaming WebSocket Chrome expects the selected Sec-Websocket-Protocol to be sent back on the WebSocket upgrade request (RFC6455 1.9). * fiddle a bit to avoid getting headers multiple times * add some explanatory notes --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
parent
b78be9fd4a
commit
4697271cef
2 changed files with 29 additions and 10 deletions
|
|
@ -22,7 +22,7 @@ import (
|
|||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
|
|
@ -236,7 +236,7 @@ func (suite *StreamingTestSuite) TestSecurityHeader() {
|
|||
|
||||
result := recorder.Result()
|
||||
defer result.Body.Close()
|
||||
b, err := ioutil.ReadAll(result.Body)
|
||||
b, err := io.ReadAll(result.Body)
|
||||
suite.NoError(err)
|
||||
|
||||
// check response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue