Fix possible issues presented by FindBugs
This commit is contained in:
parent
c99052d8f1
commit
fac4d50501
@ -1,5 +1,6 @@
|
||||
package net.frozenorb.apiv3.handler;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import io.vertx.core.Handler;
|
||||
import io.vertx.ext.web.RoutingContext;
|
||||
import net.frozenorb.apiv3.APIv3;
|
||||
@ -8,6 +9,7 @@ import net.frozenorb.apiv3.model.Server;
|
||||
import net.frozenorb.apiv3.model.User;
|
||||
import net.frozenorb.apiv3.util.ErrorUtils;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Base64;
|
||||
|
||||
public final class ActorAttributeHandler implements Handler<RoutingContext> {
|
||||
@ -28,7 +30,7 @@ public final class ActorAttributeHandler implements Handler<RoutingContext> {
|
||||
|
||||
private void processBasicAuthorization(String authHeader, RoutingContext ctx) {
|
||||
String encodedHeader = authHeader.substring("Basic ".length());
|
||||
String decodedHeader = new String(Base64.getDecoder().decode(encodedHeader.getBytes()));
|
||||
String decodedHeader = new String(Base64.getDecoder().decode(encodedHeader.getBytes(Charsets.UTF_8)), Charsets.UTF_8);
|
||||
String[] splitHeader = decodedHeader.split(":");
|
||||
|
||||
if (splitHeader.length != 2) {
|
||||
|
@ -26,7 +26,7 @@ public final class GETDump implements Handler<RoutingContext> {
|
||||
int tick = 0;
|
||||
|
||||
while (true) {
|
||||
if (tick == 0 || tick % 2 == 1) {
|
||||
if (tick == 0 || tick % 2 != 0) {
|
||||
List<UUID> banCache = new ArrayList<>();
|
||||
List<UUID> blacklistCache = new ArrayList<>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user