mirror of
https://github.com/bluenviron/mediamtx.git
synced 2026-01-23 20:09:49 -08:00
HLS: add CORS header to all responses (#389)
This commit is contained in:
parent
9f0c519582
commit
30e1ae0f51
1 changed files with 2 additions and 1 deletions
|
|
@ -533,6 +533,8 @@ func (c *Converter) runRequestHandler(terminate chan struct{}, done chan struct{
|
|||
case preq := <-c.request:
|
||||
req := preq
|
||||
|
||||
req.W.Header().Add("Access-Control-Allow-Origin", "*")
|
||||
|
||||
atomic.StoreInt64(&c.lastRequestTime, time.Now().Unix())
|
||||
|
||||
conf := c.path.Conf()
|
||||
|
|
@ -598,7 +600,6 @@ func (c *Converter) runRequestHandler(terminate chan struct{}, done chan struct{
|
|||
req.Res <- f.buf.NewReader()
|
||||
|
||||
case req.FileName == "":
|
||||
req.W.Header().Add("Access-Control-Allow-Origin", "*")
|
||||
req.Res <- bytes.NewReader([]byte(index))
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue