public boolean isTrustedForSensitiveHeaders ( String hostAddr ) { if ( ! useSensitivePrivateHeaders ) { // trustedSensitiveHeaderOrigin list is either unset (defaults to "none") or explicitly set to "none" return false ; } if ( restrictSensitiveHeaderOrigin == null ) { // trustedSensitiveHeaderOrigin is set to "*" return true ; } else { // check trustedSensitiveHeaderOrigin list for given host IP return restrictSensitiveHeaderOrigin . contains ( hostAddr . toLowerCase ( ) ) ; } }
Check to see if the source host address is one we allow for specification of sensitive private headers