Skip to content

Commit

Permalink
Use a dedicated user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
SmylerMC committed Sep 14, 2024
1 parent 036458d commit 525da1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 86 deletions.
85 changes: 0 additions & 85 deletions fabric/src/main/java/net/smyler/terramap/http/HttpStatusCodes.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.smyler.terramap.http;

import net.smyler.smylib.Strings;
import net.smyler.terramap.Terramap;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand All @@ -24,6 +25,7 @@
import static java.util.Arrays.stream;
import static java.util.Objects.requireNonNull;
import static net.smyler.smylib.Objects.optionalBiMapSupplier;
import static net.smyler.smylib.SmyLib.getGameClient;
import static net.smyler.terramap.http.CacheStatistics.CacheType.ERROR;
import static net.smyler.terramap.http.HttpStatusCodes.*;
import static net.smyler.smylib.Strings.isNullOrEmpty;
Expand All @@ -35,7 +37,8 @@ public class TerramapHttpClient implements CachingHttpClient {
private final ForkJoinPool semaphoreAcquireExecutor = new ForkJoinPool(1, HttpWorkerThread::new, this::unhandledException, true);
private final AtomicLong workerCounter = new AtomicLong(0);

private static final String USER_AGENT = "Experimental Terramap version https://github.com/SmylerMC/terramap";
private static final String USER_AGENT = UserAgent.buildUserAgent(getGameClient(), Terramap.instance());

private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter
.ofPattern("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.ENGLISH)
.withZone(ZoneId.of("GMT"));
Expand Down

0 comments on commit 525da1e

Please sign in to comment.