code: protected void updateBodyLengthHeaders(HttpBaseMessage msg) {
  
          // don't change headers if this was in response to a HEAD request
          if (!getRequestImpl().getMethodValue().equals(MethodValues.HEAD)) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Body not valid on response, fixing headers");
              }
              if (0 < msg.getContentLength()) {
                  // 366388
                  msg.removeHeader(HttpHeaderKeys.HDR_CONTENT_LENGTH);
              }
              msg.setTransferEncoding(TransferEncodingValues.NOTSET);
          }
      }
docs: When a body is not allowed to be sent on an outgoing message, certain
  headers need modification -- except for an outgoing Response to a HEAD
  request.
  
  @param msg