diff --git a/internal/core/hls_http_server.go b/internal/core/hls_http_server.go index 844b6ce5..0bbbce5f 100644 --- a/internal/core/hls_http_server.go +++ b/internal/core/hls_http_server.go @@ -101,7 +101,7 @@ func (s *hlsHTTPServer) onRequest(ctx *gin.Context) { case http.MethodOptions: ctx.Writer.Header().Set("Access-Control-Allow-Methods", "OPTIONS, GET") ctx.Writer.Header().Set("Access-Control-Allow-Headers", "Authorization, Range") - ctx.Writer.WriteHeader(http.StatusOK) + ctx.Writer.WriteHeader(http.StatusNoContent) return case http.MethodGet: diff --git a/internal/core/webrtc_http_server.go b/internal/core/webrtc_http_server.go index b6332a5d..28dbadf7 100644 --- a/internal/core/webrtc_http_server.go +++ b/internal/core/webrtc_http_server.go @@ -246,7 +246,7 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) { case http.MethodOptions: ctx.Writer.Header().Set("Access-Control-Allow-Methods", "OPTIONS, GET, POST, PATCH") ctx.Writer.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, If-Match") - ctx.Writer.WriteHeader(http.StatusOK) + ctx.Writer.WriteHeader(http.StatusNoContent) return case http.MethodGet: @@ -359,7 +359,7 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) { ctx.Writer.Header().Set("Access-Control-Allow-Methods", "OPTIONS, GET, POST, PATCH") ctx.Writer.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Type, If-Match") ctx.Writer.Header()["Link"] = iceServersToLinkHeader(servers) - ctx.Writer.WriteHeader(http.StatusOK) + ctx.Writer.WriteHeader(http.StatusNoContent) case http.MethodPost: if ctx.Request.Header.Get("Content-Type") != "application/sdp" { diff --git a/internal/core/webrtc_manager_test.go b/internal/core/webrtc_manager_test.go index 82b61d30..99ae4f3b 100644 --- a/internal/core/webrtc_manager_test.go +++ b/internal/core/webrtc_manager_test.go @@ -29,7 +29,7 @@ func whipGetICEServers( require.NoError(t, err) defer res.Body.Close() - require.Equal(t, http.StatusOK, res.StatusCode) + require.Equal(t, http.StatusNoContent, res.StatusCode) link, ok := res.Header["Link"] require.Equal(t, true, ok) @@ -464,7 +464,7 @@ func TestWebRTCPublish(t *testing.T) { require.NoError(t, err) defer res.Body.Close() - require.Equal(t, http.StatusOK, res.StatusCode) + require.Equal(t, http.StatusNoContent, res.StatusCode) if auth != "none" { _, ok := res.Header["Link"]