io.castle.client.internal.utils.HeaderNormalizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of castle-java Show documentation
Show all versions of castle-java Show documentation
Castle adds real-time monitoring of your authentication stack, instantly notifying you and your users
on potential account hijacks.
package io.castle.client.internal.utils;
import com.google.common.collect.ImmutableList;
import java.util.Iterator;
import java.util.List;
public class HeaderNormalizer {
public String normalize(String headerName) {
if (headerName == null) {
return null;
}
return headerName.toLowerCase().replaceAll("_", "-");
}
public List normalizeList(List headers) {
if (headers == null) {
return null;
}
ImmutableList.Builder builder = ImmutableList.builder();
for (Iterator iterator = headers.iterator(); iterator.hasNext(); ) {
String value = iterator.next();
builder.add(normalize(value));
}
return builder.build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy