mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-20 02:00:05 -08:00
support multiple CORS origins (#5150)
Co-authored-by: aler9 <46489434+aler9@users.noreply.github.com>
This commit is contained in:
parent
14ab95f39c
commit
ade0cddeb3
24 changed files with 441 additions and 180 deletions
|
|
@ -32,6 +32,7 @@ func (nilWriter) Write(p []byte) (int, error) {
|
|||
// - filtering of invalid requests
|
||||
type Server struct {
|
||||
Address string
|
||||
AllowOrigins []string
|
||||
ReadTimeout time.Duration
|
||||
WriteTimeout time.Duration
|
||||
Encryption bool
|
||||
|
|
@ -100,8 +101,9 @@ func (s *Server) Initialize() error {
|
|||
}
|
||||
|
||||
h := s.Handler
|
||||
h = &handlerFilterRequests{h}
|
||||
h = &handlerOrigin{h, s.AllowOrigins}
|
||||
h = &handlerServerHeader{h}
|
||||
h = &handlerFilterRequests{h}
|
||||
h = &handlerLogger{h, s.Parent}
|
||||
h = &handlerExitOnPanic{h}
|
||||
h = &handlerWriteTimeout{h, s.WriteTimeout}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue