Add CORS headers
This commit is contained in:
@@ -87,6 +87,14 @@ func ensureLivekitRoom(apiKey, apiSecret, serverURL, roomName string) error {
|
||||
}
|
||||
|
||||
func (instance *Instance) livekitTokenHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Authorization")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET, OPTIONS")
|
||||
|
||||
if r.Method == http.MethodOptions {
|
||||
return
|
||||
}
|
||||
|
||||
cfg := instance.Config.Livekit
|
||||
if cfg.APIKey == "" {
|
||||
http.NotFound(w, r)
|
||||
|
||||
Reference in New Issue
Block a user