Skip to content

Commit 19a78a1

Browse files
committed
GA4 accepts some params from User-Agent header
1 parent 98f26fd commit 19a78a1

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/net/azib/ipscan/config/Platform.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
* @author Anton Keks
1515
*/
1616
public class Platform {
17-
1817
private static final String OS_NAME = System.getProperty("os.name");
1918

20-
public static final boolean ARCH_64 = System.getProperty("os.arch").contains("64");
21-
2219
/** Mac OS detection :-) */
2320
public static final boolean MAC_OS = OS_NAME.contains("OS X");
2421

src/net/azib/ipscan/util/GoogleAnalytics.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public void report(String type, String content) {
3131
var conn = (HttpURLConnection) url.openConnection();
3232
conn.setRequestMethod("POST");
3333
conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
34+
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (ipscan/" + Version.getVersion() + " " + System.getProperty("os.name") + " " + System.getProperty("os.version") + "; Java " + System.getProperty("java.version") + ")");
3435
conn.setDoOutput(true);
3536

3637
var payload = new StringBuilder();

0 commit comments

Comments
 (0)