Add WebRTC stream id to whep response headers (#1879)
* Add WebRTC stream id to whep response headers * change header name from UUID to ID * add tests --------- Co-authored-by: Victor Vitkovskiy <victor.vitkovskiy@mirasys.com> Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
This commit is contained in:
parent
210603d7c4
commit
052da51af3
|
@ -307,6 +307,7 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) {
|
|||
ctx.Writer.Header().Set("Content-Type", "application/sdp")
|
||||
ctx.Writer.Header().Set("Access-Control-Expose-Headers", "E-Tag, Accept-Patch, Link")
|
||||
ctx.Writer.Header().Set("E-Tag", res.sx.secret.String())
|
||||
ctx.Writer.Header().Set("ID", res.sx.uuid.String())
|
||||
ctx.Writer.Header().Set("Accept-Patch", "application/trickle-ice-sdpfrag")
|
||||
ctx.Writer.Header()["Link"] = iceServersToLinkHeader(s.parent.genICEServers())
|
||||
ctx.Writer.Header().Set("Location", ctx.Request.URL.String())
|
||||
|
|
|
@ -58,7 +58,9 @@ func whipPostOffer(t *testing.T, hc *http.Client, ur string,
|
|||
require.NotEqual(t, 0, len(servers))
|
||||
|
||||
etag := res.Header.Get("E-Tag")
|
||||
require.NotEqual(t, 0, len(etag))
|
||||
require.NotEqual(t, "", etag)
|
||||
|
||||
require.NotEqual(t, "", res.Header.Get("ID"))
|
||||
|
||||
sdp, err := io.ReadAll(res.Body)
|
||||
require.NoError(t, err)
|
||||
|
|
Loading…
Reference in New Issue