mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33:12 +09:00
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:
1 parent
0398bd10f8
commit
38462d3069
2 files changed
+5
-5
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user