38public record
TrustedProxyPolicy(List<String> trustedSources,
boolean trustForwardedHeader,
boolean forwardedOnly,
39 boolean preferRightMostForwardedFor) {
42 trustedSources = trustedSources ==
null ? List.of() : List.copyOf(trustedSources);
49 public boolean isTrusted(
final String remoteAddress) {
50 if (remoteAddress ==
null || remoteAddress.isBlank()) {
53 for (
final var source : trustedSources) {
54 if (remoteAddress.equals(source) || remoteAddress.startsWith(source)) {
record TrustedProxyPolicy(List< String > trustedSources, boolean trustForwardedHeader, boolean forwardedOnly, boolean preferRightMostForwardedFor)
Política para configurar proxy de confianza en servidores.