forked from External/mediamtx
webrtc: support charset in Content-Type of WHIP offer responses (#3274)
This commit is contained in:
parent
dc3eae7f96
commit
4ed1a39da2
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/bluenviron/gortsplib/v4/pkg/format"
|
"github.com/bluenviron/gortsplib/v4/pkg/format"
|
||||||
|
|
@ -285,7 +286,7 @@ func (c *WHIPClient) postOffer(
|
||||||
}
|
}
|
||||||
|
|
||||||
contentType := res.Header.Get("Content-Type")
|
contentType := res.Header.Get("Content-Type")
|
||||||
if contentType != "application/sdp" {
|
if strings.TrimSpace(strings.Split(contentType, ";")[0]) != "application/sdp" {
|
||||||
return nil, fmt.Errorf("bad Content-Type: expected 'application/sdp', got '%s'", contentType)
|
return nil, fmt.Errorf("bad Content-Type: expected 'application/sdp', got '%s'", contentType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue