// If a site registered this endpoint, other sites should not be able to
// access it
if (site != null) {
String requestPath = request.getRequestURL().toString();
SiteURL siteUrl = null;
logger.trace("Making sure the endpoint should be accessible through site '{}'", site);
for (SiteURL url : site.getHostnames()) {
if (environment != null && !environment.equals(url.getEnvironment()))
continue;
if (requestPath.startsWith(url.toExternalForm())) {