Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix write after response commit on proxy response #7353

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ protected void service(HttpServletRequest servletRequest, HttpServletResponse se
} catch (SecurityException securityException) {
servletResponse.sendError(HttpServletResponse.SC_FORBIDDEN,
securityException.getMessage());
return;
}

// Check if the link requested is in database link list
Expand All @@ -375,19 +376,16 @@ protected void service(HttpServletRequest servletRequest, HttpServletResponse se
LinkSpecs.filter(host, null, null,
null, null, null));
if (linksFound == 0) {
String message = String.format(
"The proxy does not allow to access '%s' " +
"because the URL host was not registered in any metadata records.",
uri
);
String message = "The proxy does not allow to access the requested URI " +
"because the URL host was not registered in any metadata records.";
if (linkRepository.count() == 0) {
servletResponse.sendError(HttpServletResponse.SC_FORBIDDEN,
"The proxy is configured with DB_LINK_CHECK mode " +
"but the MetadataLink table is empty. " +
"Administrator may need to analyze record links from the admin console " +
"in order to register URL allowed by the proxy. " + message);
message = "The proxy is configured with DB_LINK_CHECK mode " +
"but the MetadataLink table is empty. " +
"Administrator may need to analyze record links from the admin console " +
"in order to register URL allowed by the proxy.";
}
servletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, message);
return;
}
proxyCallAllowed = linksFound > 0;
} catch (URISyntaxException e) {
Expand Down
Loading