mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-09 20:48:56 +00:00
Refactor to use new helper to send error response
This commit is contained in:
parent
b0ab2e07c5
commit
76b349591c
1 changed files with 2 additions and 10 deletions
|
@ -84,11 +84,7 @@ public class Oauth2Filter implements Filter {
|
|||
// Reject v1 ids, the request will be rejected by v1 anyway
|
||||
if (project.matches("^[0-9]+[bcdfghjklmnpqrstvwxyz]{6,12}$") && !project.matches("^[0-9a-f]{24}$")) {
|
||||
Log.info("[{}] Request for v1 project, refusing", project);
|
||||
HttpServletResponse response = ((HttpServletResponse) servletResponse);
|
||||
response.setContentType("text/plain");
|
||||
response.setStatus(404);
|
||||
PrintWriter w = response.getWriter();
|
||||
List<String> l = Arrays.asList(
|
||||
sendResponse(servletResponse, 404, Arrays.asList(
|
||||
"This project has not yet been moved into the new version",
|
||||
"of Overleaf. You will need to move it in order to continue working on it.",
|
||||
"Please visit this project online on www.overleaf.com to do this.",
|
||||
|
@ -98,11 +94,7 @@ public class Oauth2Filter implements Filter {
|
|||
"",
|
||||
"If this is unexpected, please contact us at support@overleaf.com, or",
|
||||
"see https://www.overleaf.com/help/342 for more information."
|
||||
);
|
||||
for (String line : l) {
|
||||
w.println(line);
|
||||
}
|
||||
w.close();
|
||||
));
|
||||
return;
|
||||
}
|
||||
Log.info("[{}] Checking if auth needed", project);
|
||||
|
|
Loading…
Add table
Reference in a new issue