forked from I2P_Developers/i2p.i2p
Console: Change sendError() to setStatus() for 3xx responses
to avoid unnecessary output
This commit is contained in:
@ -1368,7 +1368,8 @@ public class I2PSnarkServlet extends BasicServlet {
|
||||
if (p.length() > 0)
|
||||
buf.append(p.replace("&", "&")); // no you don't html escape the redirect header
|
||||
resp.setHeader("Location", buf.toString());
|
||||
resp.sendError(303, "Received");
|
||||
resp.setStatus(303);
|
||||
resp.flushBuffer();
|
||||
}
|
||||
|
||||
/** @since 0.9 */
|
||||
|
@ -63,7 +63,8 @@ public class CodedIconRendererServlet extends HttpServlet {
|
||||
I2PAppContext.getGlobalContext().logManager().getLog(getClass()).warn("Error writing binary image data for plugin", e);
|
||||
}
|
||||
} else {
|
||||
srs.sendError(304, "Not Modified");
|
||||
srs.setStatus(304);
|
||||
srs.flushBuffer();
|
||||
}
|
||||
} else {
|
||||
//Binary data is not present but must be substituted by file on disk
|
||||
|
@ -31,7 +31,7 @@ if (c != null &&
|
||||
long iflast = request.getDateHeader("If-Modified-Since");
|
||||
// iflast is -1 if not present; round down file time
|
||||
if (iflast >= ((lastmod / 1000) * 1000)) {
|
||||
response.sendError(304, "Not Modified");
|
||||
response.setStatus(304);
|
||||
return;
|
||||
}
|
||||
response.setDateHeader("Last-Modified", lastmod);
|
||||
|
@ -52,7 +52,7 @@ if (lastmod > 0) {
|
||||
long iflast = request.getDateHeader("If-Modified-Since");
|
||||
// iflast is -1 if not present; round down file time
|
||||
if (iflast >= ((lastmod / 1000) * 1000)) {
|
||||
response.sendError(304, "Not Modified");
|
||||
response.setStatus(304);
|
||||
return;
|
||||
}
|
||||
response.setDateHeader("Last-Modified", lastmod);
|
||||
|
@ -2287,7 +2287,8 @@ public class WebMail extends HttpServlet
|
||||
if (q != null && q.length() > 0)
|
||||
buf.append(q.replace("&", "&")); // no you don't html escape the redirect header
|
||||
resp.setHeader("Location", buf.toString());
|
||||
resp.sendError(303, "Received");
|
||||
resp.setStatus(303);
|
||||
resp.flushBuffer();
|
||||
Debug.debug(Debug.DEBUG, "P-R-G to " + q);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user