Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Commit

Permalink
Release v1.2.7
Browse files Browse the repository at this point in the history
*Fixed NationMilitary score data type
*Fixed an malicious access vulnerability
*Fixed charset warning for better cross-platform usage
  • Loading branch information
d1vshar committed Jan 28, 2019
1 parent 9cb3c3e commit 852967d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
7 changes: 1 addition & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.adorable-skullmaster</groupId>
<artifactId>pw4j</artifactId>
<version>1.2.6</version> <!-- FIXME version bump -->
<version>1.2.7</version> <!-- FIXME version bump -->
<name>pw4j</name>
<description>Java Wrapper for Politics and War API</description>
<packaging>jar</packaging>
Expand Down Expand Up @@ -174,11 +174,6 @@
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.8.0-beta2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class NationMilitaryContainer {
private Integer vmIndicator;
@SerializedName("score")
@Expose
private Integer score;
private Double score;
@SerializedName("soldiers")
@Expose
private Integer soldiers;
Expand Down Expand Up @@ -51,7 +51,7 @@ public Integer getVmIndicator() {
return vmIndicator;
}

public Integer getScore() {
public Double getScore() {
return score;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ApiQuery<T extends Entity> {
}

private static String convertStreamToString(java.io.InputStream is) {
java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A");
java.util.Scanner s = new java.util.Scanner(is, "UTF-8").useDelimiter("\\A");
return s.hasNext() ? s.next() : "";
}

Expand All @@ -34,7 +34,6 @@ public void buildUrlStr(boolean testServerMode) {
public Response fetchAPI() {
HttpURLConnection conn = null;
try {
System.out.println(urlStr);
URL url = new URL(urlStr);
conn = (HttpURLConnection) url.openConnection();
conn.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TradehistoryQuery extends AuthenticatedQuery implements IEntityQuer
public TradehistoryQuery(String apiKey, Integer records, ResourceType[] resources) {
super.apiKey = apiKey;
this.records = records;
this.resources = resources;
this.resources = Arrays.copyOf(resources,resources.length);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class WarsQuery implements IEntityQuery {

public WarsQuery(int wid, Integer[] aids) {
this.wid = wid;
this.aids = aids;
this.aids = Arrays.copyOf(aids,aids.length);
}

@Override
Expand Down

0 comments on commit 852967d

Please sign in to comment.