XSRF protection

This commit is contained in:
burke.davey
2010-05-25 23:17:15 +00:00
parent b667cef0ab
commit af2cec6c34

View File

@@ -48,6 +48,14 @@ public class SendServlet extends HttpServlet {
@Override @Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain"); resp.setContentType("text/plain");
//String extHeader = req.getHeader("X-Extension"); // simple XSRF protection
//if (extHeader == null) {
// resp.setStatus(400);
// resp.getWriter().println(ERROR_STATUS + " (Unauthorized: Please install latest extension)");
// return;
//}
String sel = req.getParameter("sel"); String sel = req.getParameter("sel");
if (sel == null) sel = ""; // optional if (sel == null) sel = ""; // optional