private void respond(int code, RespBody body) { MediaType contentType = HttpUtils.getDefaultContentType(); if (tokenChanged.get()) { HttpUtils.saveTokenBeforeRenderingHeaders(this, token); } if (sessionChanged.get()) { saveSession(session.decorated()); } if (response != null) { contentType = U.or(response.contentType(), contentType); } renderResponse(code, contentType, body); }
private void internalServerError(final Channel channel, final boolean isKeepAlive, final Req req) { MediaType contentType = req != null ? req.contentType() : HttpUtils.getDefaultContentType(); HttpResponseRenderer jsonRenderer = Customization.of(req).jsonResponseRenderer(); RespBody body = new RespBodyBytes(HttpUtils.responseToBytes(req, INTERNAL_SERVER_ERROR, contentType, jsonRenderer)); HttpIO.INSTANCE.respond(HttpUtils.maybe(req), channel, -1, -1, 500, isKeepAlive, contentType, body, null, null); }
MediaType contentType = HttpUtils.getDefaultContentType();
private void respond(int code, RespBody body) { MediaType contentType = HttpUtils.getDefaultContentType(); if (tokenChanged.get()) { HttpUtils.saveTokenBeforeRenderingHeaders(this, token); } if (sessionChanged.get()) { saveSession(session.decorated()); } if (response != null) { contentType = U.or(response.contentType(), contentType); } renderResponse(code, contentType, body); }
private void internalServerError(final Channel channel, final boolean isKeepAlive, final Req req) { MediaType contentType = req != null ? req.contentType() : HttpUtils.getDefaultContentType(); HttpResponseRenderer jsonRenderer = Customization.of(req).jsonResponseRenderer(); RespBody body = new RespBodyBytes(HttpUtils.responseToBytes(req, INTERNAL_SERVER_ERROR, contentType, jsonRenderer)); HttpIO.INSTANCE.respond(HttpUtils.maybe(req), channel, -1, -1, 500, isKeepAlive, contentType, body, null, null); }
String zone = null; MediaType contentType = HttpUtils.getDefaultContentType();