Esempio n. 1
0
  private HttpRequest rewriteRequest(HttpRequest request, boolean isStreaming) {
    if (!isStreaming) {
      return request;
    }

    if (!request.isChunked() || request.getContent().readable()) {
      request.setChunked(true);
      request.setContent(ChannelBuffers.EMPTY_BUFFER);
    }
    return request;
  }
Esempio n. 2
0
  private void writeHead() {
    request.setChunked(chunked);
    if (!raw) {
      request.setHeader(HttpHeaders.Names.HOST, conn.hostHeader);

      if (chunked) {
        request.setHeader(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
      } else if (contentLength == 0) {
        // request.setHeader(HttpHeaders.Names.CONTENT_LENGTH, "0");
      }
    }
    conn.write(request);
  }