@Override public void write(WebSocketResponse response) { if (ctx == null) { throw new UnsupportedOperationException("not supported on client side"); } final HttpResponsePacket responsePacket = ((HttpRequestPacket) httpContent.getHttpHeader()).getResponse(); responsePacket.setProtocol(Protocol.HTTP_1_1); responsePacket.setStatus(response.getStatus()); for (Map.Entry<String, String> entry : response.getHeaders().entrySet()) { responsePacket.setHeader(entry.getKey(), entry.getValue()); } ctx.write(HttpContent.builder(responsePacket).build()); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
public void initialize(final Connection connection, final HttpCodecFilter filter, final int initialOffset, final int maxHeaderSize, final int maxNumberOfHeaders) { headerParsingState.initialize(filter, initialOffset, maxHeaderSize); contentParsingState.trailerHeaders.setMaxNumHeaders(maxNumberOfHeaders); headers.setMaxNumHeaders(maxNumberOfHeaders); finalHttpResponse.setProtocol(Protocol.HTTP_1_1); setResponse(finalHttpResponse); setConnection(connection); }
private void write(FilterChainContext ctx, UpgradeResponse response) { final HttpResponsePacket responsePacket = ((HttpRequestPacket) ((HttpContent) ctx.getMessage()).getHttpHeader()).getResponse(); responsePacket.setProtocol(Protocol.HTTP_1_1); responsePacket.setStatus(response.getStatus()); // TODO // responsePacket.setReasonPhrase(response.getReasonPhrase()); for (Map.Entry<String, List<String>> entry : response.getHeaders().entrySet()) { responsePacket.setHeader(entry.getKey(), Utils.getHeaderFromList(entry.getValue())); } ctx.write(HttpContent.builder(responsePacket).build()); }
private void writeHttpResponse(FilterChainContext ctx, int status) { HttpResponsePacket responsePacket = getHttpRequest(ctx).getResponse(); responsePacket.setProtocol(Protocol.HTTP_1_1); responsePacket.setStatus(status); ctx.write(HttpContent.builder(responsePacket).build()); }
private void writeHttpResponse(FilterChainContext ctx, int status) { HttpResponsePacket responsePacket = getHttpRequest(ctx).getResponse(); responsePacket.setProtocol(Protocol.HTTP_1_1); responsePacket.setStatus(status); ctx.write(HttpContent.builder(responsePacket).build()); }
private void prepareOutgoingResponse(final HttpResponsePacket response) { response.setProtocol(Protocol.HTTP_2_0); String contentType = response.getContentType(); if (contentType != null) { response.getHeaders().setValue(Header.ContentType).setString(contentType); } if (response.getContentLength() != -1) { // FixedLengthTransferEncoding will set proper Content-Length header FIXED_LENGTH_ENCODING.prepareSerialize(null, response, null); } if (!response.containsHeader(Header.Date)) { response.getHeaders().addValue(Header.Date) .setBytes(FastHttpDateFormat.getCurrentDateBytes()); } }
private void prepareOutgoingResponse(final HttpResponsePacket response) { response.setProtocol(Protocol.HTTP_2_0); String contentType = response.getContentType(); if (contentType != null) { response.getHeaders().setValue(Header.ContentType).setString(contentType); } if (response.getContentLength() != -1) { // FixedLengthTransferEncoding will set proper Content-Length header FIXED_LENGTH_ENCODING.prepareSerialize(null, response, null); } if (!response.containsHeader(Header.Date)) { response.getHeaders().addValue(Header.Date) .setBytes(FastHttpDateFormat.getCurrentDateBytes()); } }
private void prepareOutgoingResponse(final HttpResponsePacket response) { response.setProtocol(Protocol.HTTP_2_0); String contentType = response.getContentType(); if (contentType != null) { response.getHeaders().setValue(Header.ContentType).setString(contentType); } if (response.getContentLength() != -1) { // FixedLengthTransferEncoding will set proper Content-Length header FIXED_LENGTH_ENCODING.prepareSerialize(null, response, null); } if (!response.containsHeader(Header.Date)) { response.getHeaders().addValue(Header.Date) .setBytes(FastHttpDateFormat.getCurrentDateBytes()); } }
private void prepareOutgoingResponse(final HttpResponsePacket response) { response.setProtocol(Protocol.HTTP_2_0); String contentType = response.getContentType(); if (contentType != null) { response.getHeaders().setValue(Header.ContentType).setString(contentType); } if (response.getContentLength() != -1) { // FixedLengthTransferEncoding will set proper Content-Length header FIXED_LENGTH_ENCODING.prepareSerialize(null, response, null); } if (!response.containsHeader(Header.Date)) { response.getHeaders().addValue(Header.Date) .setBytes(FastHttpDateFormat.getCurrentDateBytes()); } }
private void prepareOutgoingResponse(final HttpResponsePacket response) { response.setProtocol(Protocol.HTTP_2_0); String contentType = response.getContentType(); if (contentType != null) { response.getHeaders().setValue(Header.ContentType).setString(contentType); } if (response.getContentLength() != -1) { // FixedLengthTransferEncoding will set proper Content-Length header FIXED_LENGTH_ENCODING.prepareSerialize(null, response, null); } if (!response.containsHeader(Header.Date)) { response.getHeaders().addValue(Header.Date) .setBytes(FastHttpDateFormat.getCurrentDateBytes()); } }
private void prepareOutgoingResponse(final HttpResponsePacket response) { response.setProtocol(Protocol.HTTP_2_0); String contentType = response.getContentType(); if (contentType != null) { response.getHeaders().setValue(Header.ContentType).setString(contentType); } if (response.getContentLength() != -1) { // FixedLengthTransferEncoding will set proper Content-Length header FIXED_LENGTH_ENCODING.prepareSerialize(null, response, null); } if (!response.containsHeader(Header.Date)) { response.getHeaders().addValue(Header.Date) .setBytes(FastHttpDateFormat.getCurrentDateBytes()); } }