Simplified CORS method and added comment

This commit is contained in:
xRealNeon 2022-01-15 15:44:50 +01:00
parent b8dc4dac56
commit 4552153f12

View File

@ -83,10 +83,9 @@ spawn do
req = client.get("/api/v1/trending")
if req.status_code == 200
begin
if req.headers["Access-Control-Allow-Origin"] == "*"
cors = true
end
cors = (req.headers["Access-Control-Allow-Origin"] == "*")
# Try to parse the json and validate the api response
trending = JSON.parse(req.body)
trending[0]["videoId"].as_s
api = true