Skip to content

Commit

Permalink
Add user-agent to updater
Browse files Browse the repository at this point in the history
  • Loading branch information
jf908 committed Mar 24, 2024
1 parent b1f0406 commit 773c96d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/update.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ if (!fs.existsSync('svg')) {
}

// Fetch website
const res = await fetch('https://kenney.nl/assets/input-prompts');
const res = await fetch('https://kenney.nl/assets/input-prompts', {
headers: { 'User-Agent': 'github.com/jf908/Kenney-Input-Prompts' },
});
const text = await res.text();

// Extract version
Expand All @@ -21,7 +23,9 @@ if (newVersion !== latest) {
const link = text.match(/<a id='donate-text' href='([^']+)'/)[1];

// Download zip
const zip = await fetch(link);
const zip = await fetch(link, {
headers: { 'User-Agent': 'github.com/jf908/Kenney-Input-Prompts' },
});

// Create buffer
const buffer = Buffer.from(await zip.arrayBuffer());
Expand Down

0 comments on commit 773c96d

Please sign in to comment.