webrtc: unexport WHIP primitives (#3233)

This commit is contained in:
Alessandro Ros
2024-04-13 11:08:30 +02:00
committed by GitHub
parent a6cc52f0b2
commit a18bebfa58
6 changed files with 169 additions and 203 deletions

View File

@@ -207,8 +207,17 @@ func TestServerOptionsICEServer(t *testing.T) {
defer tr.CloseIdleConnections()
hc := &http.Client{Transport: tr}
iceServers, err := webrtc.WHIPOptionsICEServers(context.Background(), hc,
"http://myuser:mypass@localhost:8886/nonexisting/whep")
req, err := http.NewRequest(http.MethodOptions,
"http://myuser:mypass@localhost:8886/nonexisting/whep", nil)
require.NoError(t, err)
res, err := hc.Do(req)
require.NoError(t, err)
defer res.Body.Close()
require.Equal(t, http.StatusNoContent, res.StatusCode)
iceServers, err := webrtc.LinkHeaderUnmarshal(res.Header["Link"])
require.NoError(t, err)
require.Equal(t, []pwebrtc.ICEServer{{