Skip to content

Commit

Permalink
fix headers sending on Node 6 🐛; 0.3.1
Browse files Browse the repository at this point in the history
Node v6 doesn't support the spread operator.

follow-up of 5e96538
  • Loading branch information
derhuerst committed Jul 7, 2023
1 parent 1a4f3ce commit a6127cd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
11 changes: 7 additions & 4 deletions lib/flight.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ const request = (flight) => {
return fetch(url, {
mode: 'cors',
redirect: 'follow',
headers: {
...headers,
'User-Agent': getRandomUserAgent(),
},
headers: Object.assign(
{},
headers,
{
'User-Agent': getRandomUserAgent(),
}
),
referrer: 'no-referrer',
referrerPolicy: 'no-referrer'
})
Expand Down
11 changes: 7 additions & 4 deletions lib/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ const request = (north, west, south, east, when, opt = {}) => {
return fetch(url, {
mode: 'cors',
redirect: 'follow',
headers: {
...headers,
'User-Agent': getRandomUserAgent(),
},
headers: Object.assign(
{},
headers,
{
'User-Agent': getRandomUserAgent(),
}
),
referrer: 'no-referrer',
referrerPolicy: 'no-referrer'
})
Expand Down
2 changes: 1 addition & 1 deletion license.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017, Jannis R
Copyright (c) 2023, Jannis R

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "flightradar24-client",
"description": "Fetch aircraft data from Flightradar24.",
"version": "0.3.0",
"version": "0.3.1",
"main": "index.js",
"files": [
"index.js",
Expand Down

0 comments on commit a6127cd

Please sign in to comment.