mirror of
https://github.com/ashhhleyyy/player-pronouns.git
synced 2024-11-24 01:59:01 +00:00
fix(pronoundb): set a user-agent on outgoing requests
This commit is contained in:
parent
4dbd0ee8f8
commit
12d3785f95
1 changed files with 3 additions and 0 deletions
|
@ -36,6 +36,8 @@ import java.util.Objects;
|
|||
public class PlayerPronouns implements ModInitializer {
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(PlayerPronouns.class);
|
||||
public static final String MOD_ID = "playerpronouns";
|
||||
private static final String USER_AGENT = "player-pronouns/1.0 (+https://ashhhleyyy.dev/projects/2021/player-pronouns)";
|
||||
|
||||
private static final Map<String, String> PRONOUNDB_ID_MAP = new HashMap<>() {{
|
||||
// short pronoun set identifier map from https://pronoundb.org/docs
|
||||
put("hh", "he/him");
|
||||
|
@ -107,6 +109,7 @@ public class PlayerPronouns implements ModInitializer {
|
|||
.build();
|
||||
var req = HttpRequest.newBuilder()
|
||||
.uri(new URI(pronounDbUrl))
|
||||
.header("User-Agent", USER_AGENT)
|
||||
.GET()
|
||||
.timeout(Duration.ofSeconds(10))
|
||||
.build();
|
||||
|
|
Loading…
Reference in a new issue