mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-11 09:15:10 +00:00
575d3585fe
when some subfields of authInternalUsers or authHTTPExclude were not set explicitly in the configuration file, default values were used in their place. This is caused by a strange behavior of Go (https://github.com/golang/go/issues/21092)
23 lines
613 B
Go
23 lines
613 B
Go
package conf
|
|
|
|
import "encoding/json"
|
|
|
|
// WebRTCICEServer is a WebRTC ICE Server.
|
|
type WebRTCICEServer struct {
|
|
URL string `json:"url"`
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
ClientOnly bool `json:"clientOnly"`
|
|
}
|
|
|
|
// WebRTCICEServers is a list of WebRTCICEServer
|
|
type WebRTCICEServers []WebRTCICEServer
|
|
|
|
// UnmarshalJSON implements json.Unmarshaler.
|
|
func (s *WebRTCICEServers) UnmarshalJSON(b []byte) error {
|
|
// remove default value before loading new value
|
|
// https://github.com/golang/go/issues/21092
|
|
*s = nil
|
|
return json.Unmarshal(b, (*[]WebRTCICEServer)(s))
|
|
}
|