Comments (13)
HTTP 418
is an April Fool's Day joke, so either FlightRadar24 is trolling you or you have a malfunctioning setup.
Can you give me more details in order to reproduce the problem? Maybe all parameters or even a curl
command (you can get that from the Chrome network inspector)?
from flightradar24-client.
Hey, thanks for the quick response.
So my code is exactly the same as the example code in README, and when I try the same request url in a browser it works as expected. Request url is: https://data-live.flightradar24.com/zones/fcgi/feed.js?bounds=53%2C52%2C13%2C14&callback=jsonp&faa=1&flarm=1&mlat=1&adsb=1&air=1&gnd=0&vehicles=0&gliders=0
There's a couple of issues that Chrome is complaining about:
- Refused to set unsafe header "user-agent"
- No 'Access-Control-Allow-Origin' header is present. This is likely not related, I am able to fix it a CORS plugin in chrome.
cURL for the request:
curl 'https://data-live.flightradar24.com/zones/fcgi/feed.js?bounds=53%2C52%2C13%2C14&callback=jsonp&faa=1&flarm=1&mlat=1&adsb=1&air=1&gnd=0&vehicles=0&gliders=0' -H 'origin: http://localhost:3000' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-GB,en;q=0.8,en-US;q=0.6,fi;q=0.4' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36' -H 'accept: /' -H 'referer: http://localhost:3000/' -H 'authority: data-live.flightradar24.com' --compressed
from flightradar24-client.
when I try the same request url in a browser it works as expected. Request url is: [...]
cURL for the request: [...]
The curl
command reproduces the 418
error. It is certainly a weird choice done by FlightRadar24 to return an "I'm a teapot" error on any of their public routes.
No 'Access-Control-Allow-Origin' header is present. This is likely not related, I am able to fix it a CORS plugin in chrome.
I will fix this. My code already fetch
es in CORS mode, so this must be your setup.
from flightradar24-client.
I successfully nailed it down to the Referer: http://localhost:3000/
header. Referer: http://foo.bar.horse:3000/
works fine.
from flightradar24-client.
Maybe we can ping someone from @Flightradar24 ?
from flightradar24-client.
Hmm, so is there a way I can hack the referer
to an ok value to make it work? For my use case it would just probably be running on localhost and be displayed on a screen
from flightradar24-client.
FlightRadar24 may try to block unauthorised access to their API using this trick. I can set up a CORS proxy that strips the Referer
at any time though to circumvent it.
I will try to set the referrer
option of fetch
to no-referrer
. But I'm not sure it's supported in every browser.
from flightradar24-client.
Can you confirm it's fixed as of the current master
(3eae7ab
)?
from flightradar24-client.
hmm, still facing the same issue with 3eae7ab
(0.2.1). Tested on chrome and firefox.
cURL:
curl 'https://data-live.flightradar24.com/zones/fcgi/feed.js?bounds=53%2C52%2C13%2C14&callback=jsonp&faa=1&flarm=1&mlat=1&adsb=1&air=1&gnd=0&vehicles=0&gliders=0' -H 'origin: http://localhost:3000' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-GB,en;q=0.8,en-US;q=0.6,fi;q=0.4' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36' -H 'accept: /' -H 'referer: http://localhost:3000/' -H 'authority: data-live.flightradar24.com' --compressed
from flightradar24-client.
Can you show me the headers being sent? You can see them in the network inspector, when selecting the request.
from flightradar24-client.
This is what you're looking for, right?
:authority:data-live.flightradar24.com
:method:GET
:path:/zones/fcgi/feed.js?bounds=53%2C52%2C13%2C14&callback=jsonp&faa=1&flarm=1&mlat=1&adsb=1&air=1&gnd=0&vehicles=0&gliders=0
:scheme:https
accept:/
accept-encoding:gzip, deflate, br
accept-language:en-GB,en;q=0.8,en-US;q=0.6,fi;q=0.4
origin:http://localhost:3000
referer:http://localhost:3000/
user-agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
from flightradar24-client.
Apparently your browser still sent the Referer
header. Try again with the latest master
(faf206b
).
from flightradar24-client.
I assume this has been fixed. Please reopen if the issue still persists.
from flightradar24-client.
Related Issues (20)
- TypeError: Cannot read property 'id' of undefined HOT 7
- add hint that the altitude is in feet HOT 4
- Improvement: Process additional JSON fields HOT 6
- An in-range update of fetch-ponyfill is breaking the build 🚨 HOT 2
- An in-range update of tape is breaking the build 🚨 HOT 1
- INFO: Added a new use of your module HOT 1
- An in-range update of moment-timezone is breaking the build 🚨 HOT 2
- An in-range update of tape is breaking the build 🚨 HOT 1
- An in-range update of moment-timezone is breaking the build 🚨 HOT 4
- adapt to the latest endpoint changes HOT 1
- An in-range update of moment-timezone is breaking the build 🚨 HOT 1
- An in-range update of tap-min is breaking the build 🚨 HOT 2
- can it be used with react-native ? HOT 2
- api calls are failing with 'forbidden' HOT 4
- API call again forbidden HOT 10
- Legal prosecutions 🤦🏻♂️
- broken due to api changes on flightradar site HOT 4
- add Typescript types declaration file (.d.ts) HOT 1
- README -- add shebang and command to run the code HOT 4
- clarify the meaning of north, west, south, east HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flightradar24-client.