Move whitelist logic check up to the top level to avoid doing processing on any requests that do not match.