Enable CORS for go2rtc by default (#5610)

* Enable CORS for go2rtc by default

* Fix typo
This commit is contained in:
Nicolas Mowen 2023-03-03 16:43:50 -07:00 committed by GitHub
parent 17c26c9fa9
commit 42eaa13402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,12 @@ elif config_file.endswith(".json"):
go2rtc_config: dict[str, any] = config.get("go2rtc", {}) go2rtc_config: dict[str, any] = config.get("go2rtc", {})
# Need to enable CORS for go2rtc so the frigate integration / card work automatically
if go2rtc_config.get("api") is None:
go2rtc_config["api"] = {"origin": "*"}
elif go2rtc_config["api"].get("origin") is None:
go2rtc_config["api"]["origin"] = "*"
# we want to ensure that logs are easy to read # we want to ensure that logs are easy to read
if go2rtc_config.get("log") is None: if go2rtc_config.get("log") is None:
go2rtc_config["log"] = {"format": "text"} go2rtc_config["log"] = {"format": "text"}