[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:
Leah Neukirchen
2024-08-06 11:52:27 +02:00
committed by GitHub
parent b78be9fd4a
commit 4697271cef
2 changed files with 29 additions and 10 deletions

View File

@@ -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