@Override
    public InputStream fetch(String fetchKey, Metadata metadata, ParseContext parseContext) throws IOException, TikaException {
        HttpFetcherConfig additionalHttpFetcherConfig = getAdditionalHttpFetcherConfig(parseContext);
        HttpGet get = new HttpGet(fetchKey);
        RequestConfig requestConfig = RequestConfig
                .custom()
                .setMaxRedirects(httpFetcherConfig.getMaxRedirects())
                .setRedirectsEnabled(httpFetcherConfig.getMaxRedirects() > 0)
                .build();
        get.setConfig(requestConfig);
        setHttpRequestHeaders(metadata, get);
        putAdditionalHeadersOnRequest(additionalHttpFetcherConfig, get);
        return execute(get, metadata, httpClient, true);
    }
@Test
    @Disabled("requires network connectivity")
    public void testRange() throws Exception {
        String url = "https://commoncrawl.s3.amazonaws.com/crawl-data/CC-MAIN-2020-45/segments/1603107869785.9/warc/CC-MAIN-20201020021700-20201020051700-00529.warc.gz";
        long start = 969596307;
        long end = start + 1408 - 1;
        Metadata metadata = new Metadata();
        HttpFetcher httpFetcher = (HttpFetcher) getFetcherManager("tika-config-http.xml").getFetcher("http");
        try (TemporaryResources tmp = new TemporaryResources()) {
            Path tmpPath = tmp.createTempFile(metadata);
            try (InputStream is = httpFetcher.fetch(url, start, end, metadata)) {
                Files.copy(new GZIPInputStream(is), tmpPath, StandardCopyOption.REPLACE_EXISTING);
            }
            assertEquals(2461, Files.size(tmpPath));
        }
    }