Proper HTTP encoding for username rewrite

This commit is contained in:
Max Dor
2018-12-21 16:48:29 +01:00
parent e9c29f1c03
commit ad1b91f370

View File

@@ -58,6 +58,7 @@ import org.springframework.stereotype.Service;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@@ -267,7 +268,7 @@ public class AuthManager {
log.warn("Expected HS to return data but got nothing"); log.warn("Expected HS to return data but got nothing");
return ""; return "";
} else { } else {
return IOUtils.toString(httpResponse.getEntity().getContent(), httpResponse.getEntity().getContentType().getValue()); return IOUtils.toString(httpResponse.getEntity().getContent(), StandardCharsets.UTF_8);
} }
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);