Remove any protocol-level headers from the remote server's response that
do not apply to the new response we are sending.

@param response
13770
protected void prepareForwardedResponseHeaders(ResponseData response) {
        HttpHeaders headers = response.getHeaders();
        headers.remove(TRANSFER_ENCODING);
        headers.remove(CONNECTION);
        headers.remove("Public-Key-Pins");
        headers.remove(SERVER);
        headers.remove("Strict-Transport-Security");
    }
302899
protected void preventCaching(final HttpServletResponse response) {
        response.setHeader("Pragma", NO_CACHE);
        response.setDateHeader("Expires", 1L);
        response.setHeader(CACHE_CONTROL, NO_CACHE);
        response.addHeader(CACHE_CONTROL, "no-store");
    }
91759
@Deprecated
    public static void removeHeader(HttpMessage message, CharSequence name) {
        message.headers().remove(name);
    }
221192
private void clearAllHeaders() {
        final boolean bTrace = TraceComponent.isAnyTracingEnabled();
        if (bTrace && tc.isEntryEnabled()) {
            Tr.entry(tc, "clearAllHeaders()");
        }

        HeaderElement elem = this.hdrSequence;
        while (null != elem) {
            final HeaderElement next = elem.nextSequence;
            final HeaderKeys key = elem.getKey();
            final int ord = key.getOrdinal();
            if (storage.containsKey(ord)) {
                // first instance being removed
                if (key.useFilters()) {
                    filterRemove(key, null);
                }
                storage.remove(ord);
            }
            elem.destroy();
            elem = next;
        }
        this.hdrSequence = null;
        this.lastHdrInSequence = null;
        this.numberOfHeaders = 0;
        if (bTrace && tc.isEntryEnabled()) {
            Tr.exit(tc, "clearAllHeaders()");
        }
    }
177257
public final void setCustomResponseHeaders (@Nullable final HttpHeaderMap aOther)
  {
    m_aResponseHeaderMap.removeAll ();
    if (aOther != null)
      m_aResponseHeaderMap.setAllHeaders (aOther);
  }
430470
def read_response_headers(response)
      raw_headers = response.headers
      headers = {}
      EXCLUDE_RESPONSE_HEADER_PATTERNS.each do |pattern|
        raw_headers = raw_headers.reject { |h| h if h.starts_with? pattern }
      end
      raw_headers.each do |key, val|
        headers.merge!(cleanup_header(key) => val)
      end
      headers
    end
1176629
public static void setNonCachingHeaders(@NotNull HttpServletResponse response) {
    response.setHeader(HEADER_PRAGMA, "no-cache");
    response.setHeader(HEADER_CACHE_CONTROL, "no-cache");
    response.setHeader(HEADER_EXPIRES, "0");
    response.setHeader(HEADER_DISPATCHER, "no-cache");
  }
171222
public void cleanup() {
        synchronized (_sslMap) {
            for (SslRelayOdo relay : _sslMap.values()) {
                if (relay.getHttpServer() != null && relay.isStarted()) {
                    relay.getHttpServer().removeListener(relay);
                }
            }

            sslRelays.clear();
        }
    }
302980
protected void handleResponse(HttpRequest<?> request, MutableHttpResponse<?> response) {
        HttpHeaders headers = request.getHeaders();
        Optional<String> originHeader = headers.getOrigin();
        originHeader.ifPresent(requestOrigin -> {

            Optional<CorsOriginConfiguration> optionalConfig = getConfiguration(requestOrigin);

            if (optionalConfig.isPresent()) {
                CorsOriginConfiguration config = optionalConfig.get();

                if (CorsUtil.isPreflightRequest(request)) {
                    Optional<HttpMethod> result = headers.getFirst(ACCESS_CONTROL_REQUEST_METHOD, HttpMethod.class);
                    setAllowMethods(result.get(), response);
                    Argument<List> type = Argument.of(List.class, String.class);
                    Optional<List> allowedHeaders = headers.get(ACCESS_CONTROL_REQUEST_HEADERS, type);
                    allowedHeaders.ifPresent(val ->
                        setAllowHeaders(val, response)
                    );

                    setMaxAge(config.getMaxAge(), response);
                }

                setOrigin(requestOrigin, response);
                setVary(response);
                setExposeHeaders(config.getExposedHeaders(), response);
                setAllowCredentials(config, response);
            }
        });
    }
1357932
private static void processSurrogateControlContent(HttpResponse response, boolean keepHeader) {
        if (!response.containsHeader(H_SURROGATE_CONTROL)) {
            return;
        }

        if (!keepHeader) {
            response.removeHeaders(H_SURROGATE_CONTROL);
            return;
        }

        MoveResponseHeader.moveHeader(response, H_X_NEXT_SURROGATE_CONTROL, H_SURROGATE_CONTROL);
    }
365512
public static boolean clearCookie(Cookie[] cookies, HttpServletResponse response) {
        if (Checker.isNotEmpty(cookies)) {
            for (Cookie cookie : cookies) {
                removeCookie(cookie, response);
            }
            return true;
        }
        return false;
    }
640378
def cleanup_headers(self):
        """"""
        headers = {'Content-Type': 'application/json'}
        headers['Authorization'] = self.__token
        self.__headers = headers
        self.__params = {}
729342
@BuilderMethod
    public void setHttpHeaders(@NonNull Map<String, String> headers) {
        this.httpHeaders.clear();
        this.httpHeaders.putAll(headers);
    }
237702
public void releaseResponse(HttpResponseMessageImpl response) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "releaseResponse: " + response);
        }
        this.respPool.put(response);
    }
1176148
public void handleResponse(String response) {
        if (messageListener != null) {
            log.debug("Sending Http response");
            messageListener.onOutboundMessage(new RawMessage(response), null);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Sending Http response:" + NEWLINE + response);
            }
        }
    }
738153
public void doHead(String url, HttpResponse response, Map<String, Object> headers) {
        response.setRequest(url);
        httpClient.head(url, response, headers);
    }
1364102
public void doDelete(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
        httpClient.delete(url, result, headers, contentType);
    }