mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-15 05:41:51 +08:00
Added User-Agent to Ore update checker to fix 403 error
This commit is contained in:
parent
ea7a214ef4
commit
967adb226a
@ -76,6 +76,7 @@ public class OreVersionInfoLoader {
|
||||
connection.setDoOutput(true);
|
||||
connection.setRequestMethod("GET");
|
||||
connection.setRequestProperty("Authorization", String.format("OreApi session=\"%s\"", session));
|
||||
connection.setRequestProperty("User-Agent", "Player Analytics Update Checker");
|
||||
connection.connect();
|
||||
try (InputStream in = connection.getInputStream()) {
|
||||
JsonArray versions = new JsonParser().parse(readInputFully(in)).getAsJsonObject().get("result").getAsJsonArray();
|
||||
@ -94,6 +95,7 @@ public class OreVersionInfoLoader {
|
||||
try {
|
||||
connection.setDoOutput(true);
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("User-Agent", "Player Analytics Update Checker");
|
||||
connection.connect();
|
||||
try (InputStream in = connection.getInputStream()) {
|
||||
return new JsonParser().parse(readInputFully(in)).getAsJsonObject().get("session").getAsString();
|
||||
|
Loading…
Reference in New Issue
Block a user