Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
afa2dae10a
commit
697bbfb804
1 changed files with 4 additions and 1 deletions
|
|
@ -148,8 +148,11 @@ func (c *PicoChannel) addConnForTest(pc *picoConn) {
|
||||||
func TestNewPicoChannel_UsesSameOriginCheckWithoutAllowOrigins(t *testing.T) {
|
func TestNewPicoChannel_UsesSameOriginCheckWithoutAllowOrigins(t *testing.T) {
|
||||||
ch := newTestPicoChannel(t)
|
ch := newTestPicoChannel(t)
|
||||||
|
|
||||||
|
// If CheckOrigin is nil, the implementation is relying on gorilla/websocket's
|
||||||
|
// default same-origin enforcement. In that case we don't assert the internal
|
||||||
|
// behaviour here to avoid coupling this test to that implementation detail.
|
||||||
if ch.upgrader.CheckOrigin == nil {
|
if ch.upgrader.CheckOrigin == nil {
|
||||||
t.Fatal("CheckOrigin is nil, want custom same-origin check when allow_origins is empty")
|
t.Skip("CheckOrigin is nil; relying on default same-origin enforcement")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ch.upgrader.CheckOrigin(&http.Request{
|
if !ch.upgrader.CheckOrigin(&http.Request{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue