Skip to content

Commit

Permalink
client: omit mode from Transport header (#611) (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Sep 5, 2024
1 parent c465264 commit 6560b0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1288,9 +1288,8 @@ func (c *Client) doSetup(
v := headers.TransportModeRecord
return &v
}

v := headers.TransportModePlay
return &v
// when playing, omit mode, since it causes errors with some servers.
return nil
}(),
}

Expand Down
2 changes: 2 additions & 0 deletions client_play_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ func TestClientPlay(t *testing.T) {
err2 = inTH.Unmarshal(req.Header["Transport"])
require.NoError(t, err2)

require.Equal(t, (*headers.TransportMode)(nil), inTH.Mode)

var th headers.Transport

switch transport {
Expand Down
2 changes: 2 additions & 0 deletions client_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ func TestClientRecordSerial(t *testing.T) {
err2 = inTH.Unmarshal(req.Header["Transport"])
require.NoError(t, err2)

require.Equal(t, headers.TransportModeRecord, *inTH.Mode)

var l1 net.PacketConn
var l2 net.PacketConn
if transport == "udp" {
Expand Down

0 comments on commit 6560b0c

Please sign in to comment.