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") req = client.get("/api/v1/trending")
if req.status_code == 200 if req.status_code == 200
begin begin
if req.headers["Access-Control-Allow-Origin"] == "*" cors = (req.headers["Access-Control-Allow-Origin"] == "*")
cors = true
end
# Try to parse the json and validate the api response
trending = JSON.parse(req.body) trending = JSON.parse(req.body)
trending[0]["videoId"].as_s trending[0]["videoId"].as_s
api = true api = true