mirror of
https://github.com/iv-org/instances-api.git
synced 2025-06-08 14:52:42 -04:00
Simplified CORS method and added comment
This commit is contained in:
parent
b8dc4dac56
commit
4552153f12
1 changed files with 2 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue