mirror of
https://github.com/plexusorg/Module-HTTPD.git
synced 2026-06-05 17:46:53 +00:00
Set Content-Type header to application/json for JSON endpoints (closes #6)
This commit is contained in:
@@ -80,6 +80,8 @@ public class PunishmentsEndpoint extends AbstractServlet
|
||||
return new GsonBuilder().registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeSerializer()).setPrettyPrinting().create().toJson(punishedPlayer.getPunishments().stream().peek(punishment -> punishment.setIp("")).toList());
|
||||
}
|
||||
}
|
||||
|
||||
response.setHeader("content-type", "application/json");
|
||||
return new GsonBuilder().registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeSerializer()).setPrettyPrinting().create().toJson(punishedPlayer.getPunishments().stream().toList());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user