@Override
    public void render(OutputStream output, ContentChannel networkChannel, CompletionHandler handler) throws IOException {
        if (rendererCopy instanceof AsynchronousSectionedRenderer<Result> renderer) {
            renderer.setNetworkWiring(networkChannel, handler);
        }
        try {
            try {
                long nanoStart = System.nanoTime();
                CompletableFuture<Boolean> promise = asyncRender(output);
                if (metric != null) {
                    promise.whenComplete((__, ___) -> new RendererLatencyReporter(nanoStart).run());
                }
            } finally {
                if (!(rendererCopy instanceof AsynchronousSectionedRenderer)) {
                    output.flush();
                }
            }
        } finally {
            if (networkChannel != null && !(rendererCopy instanceof AsynchronousSectionedRenderer)) {
                networkChannel.close(handler);
            }
        }
    }
Copy custom HTTP headers from the search result over to the HTTP response.

@param outputHeaders the headers which will be sent to a client
@param searchHeaders the headers from the search result, or null
container-search/src/main/java/com/yahoo/search/handler/HttpSearchResponse.java