mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-26 01:00:23 +08:00
webrtc: fix ETag header name according to specification (#2396) (#2401)
Some checks reported warnings
test / test64 (push) Has been cancelled
test / test32 (push) Has been cancelled
test / test_highlevel (push) Has been cancelled
lint / code (push) Has been cancelled
lint / mod-tidy (push) Has been cancelled
lint / apidocs (push) Has been cancelled
Some checks reported warnings
test / test64 (push) Has been cancelled
test / test32 (push) Has been cancelled
test / test_highlevel (push) Has been cancelled
lint / code (push) Has been cancelled
lint / mod-tidy (push) Has been cancelled
lint / apidocs (push) Has been cancelled
This commit is contained in:
@@ -262,8 +262,8 @@ 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("Access-Control-Expose-Headers", "ETag, Accept-Patch, Link")
|
||||
ctx.Writer.Header().Set("ETag", 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"] = whip.LinkHeaderMarshal(servers)
|
||||
|
||||
@@ -346,7 +346,7 @@ class Transmitter {
|
||||
if (res.status !== 201) {
|
||||
throw new Error('bad status code');
|
||||
}
|
||||
this.eTag = res.headers.get('E-Tag');
|
||||
this.eTag = res.headers.get('ETag');
|
||||
return res.text();
|
||||
})
|
||||
.then((sdp) => this.onRemoteAnswer(new RTCSessionDescription({
|
||||
|
||||
@@ -155,7 +155,7 @@ class WHEPClient {
|
||||
if (res.status !== 201) {
|
||||
throw new Error('bad status code');
|
||||
}
|
||||
this.eTag = res.headers.get('E-Tag');
|
||||
this.eTag = res.headers.get('ETag');
|
||||
return res.text();
|
||||
})
|
||||
.then((sdp) => this.onRemoteAnswer(new RTCSessionDescription({
|
||||
|
||||
@@ -88,7 +88,7 @@ func TestWebRTCSource(t *testing.T) {
|
||||
|
||||
w.Header().Set("Content-Type", "application/sdp")
|
||||
w.Header().Set("Accept-Patch", "application/trickle-ice-sdpfrag")
|
||||
w.Header().Set("E-Tag", "test_etag")
|
||||
w.Header().Set("ETag", "test_etag")
|
||||
w.Header().Set("Location", "/my/resource/sessionid")
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
w.Write([]byte(pc.LocalDescription().SDP))
|
||||
|
||||
@@ -53,9 +53,9 @@ func PostOffer(
|
||||
|
||||
Location := res.Header.Get("Location")
|
||||
|
||||
etag := res.Header.Get("E-Tag")
|
||||
etag := res.Header.Get("ETag")
|
||||
if etag == "" {
|
||||
return nil, fmt.Errorf("E-Tag is missing")
|
||||
return nil, fmt.Errorf("ETag is missing")
|
||||
}
|
||||
|
||||
sdp, err := io.ReadAll(res.Body)
|
||||
|
||||
Reference in New Issue
Block a user