private void render(HttpServletRequest req, HttpServletResponse resp, UriStatus urlstatus) throws IOException { if (req.getHeader(HttpRequest.DOS_PREVENTION_HEADER) != null) { // Refuse to render for any request that came from us. // TODO: Is this necessary for any other type of request? Rendering seems to be the only one // that can potentially result in an infinite loop. resp.sendError(HttpServletResponse.SC_FORBIDDEN); return; } resp.setContentType("text/html"); resp.setCharacterEncoding("UTF-8"); GadgetContext context = new HttpGadgetContext(req); RenderingResults results = renderer.render(context); // process the rendering results postGadgetRendering(new PostGadgetRenderingParams(req, resp, urlstatus, context, results)); }
private void render(HttpServletRequest req, HttpServletResponse resp, UriStatus urlstatus) throws IOException { if (req.getHeader(HttpRequest.DOS_PREVENTION_HEADER) != null) { // Refuse to render for any request that came from us. // TODO: Is this necessary for any other type of request? Rendering seems to be the only one // that can potentially result in an infinite loop. resp.sendError(HttpServletResponse.SC_FORBIDDEN); return; } resp.setContentType("text/html"); resp.setCharacterEncoding("UTF-8"); GadgetContext context = new HttpGadgetContext(req); RenderingResults results = renderer.render(context); // process the rendering results postGadgetRendering(new PostGadgetRenderingParams(req, resp, urlstatus, context, results)); }
private void render(HttpServletRequest req, HttpServletResponse resp, UriStatus urlstatus) throws IOException { if (req.getHeader(HttpRequest.DOS_PREVENTION_HEADER) != null) { // Refuse to render for any request that came from us. // TODO: Is this necessary for any other type of request? Rendering seems to be the only one // that can potentially result in an infinite loop. resp.sendError(HttpServletResponse.SC_FORBIDDEN); return; } resp.setContentType("text/html"); resp.setCharacterEncoding("UTF-8"); GadgetContext context = new HttpGadgetContext(req); RenderingResults results = renderer.render(context); // process the rendering results postGadgetRendering(new PostGadgetRenderingParams(req, resp, urlstatus, context, results)); }