From 53f70085891cdb0feae56df8990c1245091352a1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 1 Dec 2015 15:18:13 +1300 Subject: Fix warning reported by FindBugs tool --- src/org/traccar/api/SecurityRequestFilter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/api/SecurityRequestFilter.java b/src/org/traccar/api/SecurityRequestFilter.java index b1e090487..63295a8b7 100644 --- a/src/org/traccar/api/SecurityRequestFilter.java +++ b/src/org/traccar/api/SecurityRequestFilter.java @@ -18,6 +18,7 @@ package org.traccar.api; import org.traccar.Context; import org.traccar.model.User; +import java.nio.charset.Charset; import java.sql.SQLException; import javax.ws.rs.WebApplicationException; import javax.ws.rs.container.ContainerRequestContext; @@ -35,7 +36,7 @@ public class SecurityRequestFilter implements ContainerRequestFilter { auth = auth.replaceFirst("[B|b]asic ", ""); byte[] decodedBytes = DatatypeConverter.parseBase64Binary(auth); if (decodedBytes != null && decodedBytes.length > 0) { - return new String(decodedBytes).split(":", 2); + return new String(decodedBytes, Charset.defaultCharset()).split(":", 2); } return null; } -- cgit v1.2.3