Skip to content

Commit

Permalink
Added user agent and referer to CDN fetches
Browse files Browse the repository at this point in the history
  • Loading branch information
cvasseng committed Feb 19, 2025
1 parent a723e4d commit 97b59b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ async function fetch(url, requestOptions = {}) {
const protocol = getProtocol(url);

protocol
.get(url, requestOptions, (res) => {
.get(url, Object.assign({
headers: {
'User-Agent': 'highcharts/export',
'Referer': 'highcharts.export'
}
}, requestOptions || {}), (res) => {
let data = '';

// A chunk of data has been received.
Expand Down

0 comments on commit 97b59b7

Please sign in to comment.