@Override public boolean removeAdditionalRequestHeader(AsciiString name) { requireNonNull(name, "name"); final HttpHeaders additionalRequestHeaders = this.additionalRequestHeaders; if (additionalRequestHeaders == null) { return false; } return additionalRequestHeaders.remove(name); }
@Override public boolean removeAdditionalResponseHeader(AsciiString name) { requireNonNull(name, "name"); return createAdditionalHeadersIfAbsent().remove(name); }
@Override public boolean removeAdditionalResponseTrailer(AsciiString name) { requireNonNull(name, "name"); return createAdditionalTrailersIfAbsent().remove(name); }
/** * Creates a new HTTP message. * * @param informationals the informational class (1xx) HTTP headers * @param headers the HTTP headers * @param content the content of the HTTP message * @param trailingHeaders the trailing HTTP headers */ static AggregatedHttpMessage of(Iterable<HttpHeaders> informationals, HttpHeaders headers, HttpData content, HttpHeaders trailingHeaders) { requireNonNull(informationals, "informationals"); requireNonNull(headers, "headers"); requireNonNull(content, "content"); requireNonNull(trailingHeaders, "trailingHeaders"); // Set the 'content-length' header if possible. final HttpStatus status = headers.status(); final HttpHeaders newHeaders; if (status != null) { // Response newHeaders = setOrRemoveContentLength(headers, content, trailingHeaders); } else { // Request newHeaders = headers.toMutable(); if (content.isEmpty()) { newHeaders.remove(CONTENT_LENGTH); } else { newHeaders.setInt(CONTENT_LENGTH, content.length()); } } return new DefaultAggregatedHttpMessage(ImmutableList.copyOf(informationals), newHeaders, content, trailingHeaders); }
headers.remove(CONTENT_LENGTH); } else { headers.setInt(CONTENT_LENGTH, content.length());
mutable.remove(HttpHeaderNames.CONTENT_LENGTH); switch (encodingType) { case GZIP:
grpcHeaders.remove(GrpcHeaderNames.GRPC_ACCEPT_ENCODING);
duplicateReq.headers().remove(HttpHeaderNames.AUTHORITY);
grpcHeaders.remove(GrpcHeaderNames.GRPC_ACCEPT_ENCODING);