-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix unexpected behavior of authInternalUsers or authHTTPExclude (#3316)
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 (golang/go#21092)
- Loading branch information
Showing
5 changed files
with
93 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
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)) | ||
} |