- Throw 403 instead of 404 from flags.jsp and viewstat.jsp

so we don't render error.jsp
This commit is contained in:
zzz
2009-08-22 16:23:15 +00:00
parent 22c0b8e524
commit 35c9e99914
2 changed files with 13 additions and 2 deletions

View File

@ -25,6 +25,12 @@ if (c != null && c.length() > 0) {
if (rendered) if (rendered)
cout.close(); cout.close();
} }
/*
* Send a 403 instead of a 404, because the server sends error.jsp
* for 404 errors, complete with the summary bar, which would be
* a huge load for a page full of flags if the user didn't have the
* flags directory for some reason.
*/
if (!rendered) if (!rendered)
response.sendError(404, "Not found"); response.sendError(403, "Flag not found");
%> %>

View File

@ -63,7 +63,12 @@ if ( !rendered && ((rs != null) || fakeBw) ) {
} }
} catch (NumberFormatException nfe) {} } catch (NumberFormatException nfe) {}
} }
/*
* Send a 403 instead of a 404, because the server sends error.jsp
* for 404 errors, complete with the summary bar, which would be
* a huge load for a page full of graphs if there's a problem
*/
if (!rendered) { if (!rendered) {
response.sendError(404, "That stat is not available"); response.sendError(403, "That stat is not available");
} }
%> %>