@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 testRedirect() throws Exception {
        String url = "https://t.co/cvfkWAEIxw?amp=1";
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        Metadata metadata = new Metadata();
        HttpFetcher httpFetcher = (HttpFetcher) getFetcherManager("tika-config-http.xml").getFetcher("http");
        try (InputStream is = httpFetcher.fetch(url, metadata, new ParseContext())) {
            IOUtils.copy(is, bos);
        }
        //debug(metadata);
    }