void startResponse(Resp resp, Channel channel, int code, boolean isKeepAlive, MediaType contentType) { channel.write(code == 200 ? HTTP_200_OK : HttpResponseCodes.get(code)); addDefaultHeaders(channel, isKeepAlive, contentType); if (resp != null) { if (U.notEmpty(resp.headers())) { for (Map.Entry<String, String> e : resp.headers().entrySet()) { addCustomHeader(channel, e.getKey().getBytes(), e.getValue().getBytes()); } } if (U.notEmpty(resp.cookies())) { for (Map.Entry<String, String> e : resp.cookies().entrySet()) { String cookie = e.getKey() + "=" + e.getValue(); addCustomHeader(channel, HttpHeaders.SET_COOKIE.getBytes(), cookie.getBytes()); } } } }
addCustomHeader(channel, e.getKey().getBytes(), e.getValue().getBytes()); for (Map.Entry<String, String> e : cookies.entrySet()) { String cookie = e.getKey() + "=" + e.getValue(); addCustomHeader(channel, HttpHeaders.SET_COOKIE.getBytes(), cookie.getBytes());
void startResponse(Resp resp, Channel channel, int code, boolean isKeepAlive, MediaType contentType) { channel.write(code == 200 ? HTTP_200_OK : HttpResponseCodes.get(code)); addDefaultHeaders(channel, isKeepAlive, contentType); if (resp != null) { if (U.notEmpty(resp.headers())) { for (Map.Entry<String, String> e : resp.headers().entrySet()) { addCustomHeader(channel, e.getKey().getBytes(), e.getValue().getBytes()); } } if (U.notEmpty(resp.cookies())) { for (Map.Entry<String, String> e : resp.cookies().entrySet()) { String cookie = e.getKey() + "=" + e.getValue(); addCustomHeader(channel, HttpHeaders.SET_COOKIE.getBytes(), cookie.getBytes()); } } } }
addCustomHeader(channel, e.getKey().getBytes(), e.getValue().getBytes()); for (Map.Entry<String, String> e : cookies.entrySet()) { String cookie = e.getKey() + "=" + e.getValue(); addCustomHeader(channel, HttpHeaders.SET_COOKIE.getBytes(), cookie.getBytes());