Set User-Agent according to GitHub's request

GitHub requests that the user agent be set to either the name of the
user or the application[1].  Set user agent to the name of this
application as they request.

[1] https://developer.github.com/v3/#user-agent-required
This commit is contained in:
Hornwitser committed 2019-08-24 11:02:50 +02:00
1 parent 0398bd10f8
commit 38462d3069
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -271,7 +271,7 @@ if (!command || command == "help" || command == "--help") {
} else if (command == "download") {
console.log("Downloading mods...");
// get JSON data about releases
let res = syncRequest('GET', 'https://api.github.com/repos/Danielv123/factorioClusterioMod/releases', {"headers":{"User-Agent":"Fuck you for requiring user agents!"}});
let res = syncRequest('GET', 'https://api.github.com/repos/Danielv123/factorioClusterioMod/releases', {"headers":{"User-Agent":"factorioClusterio"}});
let url = JSON.parse(res.getBody())[0].assets[0].browser_download_url;
let name = JSON.parse(res.getBody())[0].assets[0].name;
if(url) {