prebid-server-java icon indicating copy to clipboard operation
prebid-server-java copied to clipboard

RemoteFileSyncer does not follow redirects (http status 302 with location header)

Open az-auddin opened this issue 1 year ago • 2 comments

Even though we have setup http-client properties to have max-redirects: 3 (ref: GeoLocationConfiguration#createGeoLocationService() ), RemoteFileSyncer is not able to follow redirect.

As of tag 2.15.0, RemoteFileSyncer has this:

    private Future<HttpClientResponse> requestData() {
        final Promise<HttpClientResponse> promise = Promise.promise();
        httpClient.getAbs(downloadUrl, promise::complete).end();
        return promise.future();
    }

We need to change to this to make it work:

    private Future<HttpClientResponse> requestData() {
        .........
        httpClient.getAbs(downloadUrl, promise::complete).setFollowRedirects(true).end();
        .........
    }

az-auddin avatar May 22 '24 08:05 az-auddin

@az-auddin - this sounds fine. We'll put in on the list, but community PRs are welcome -- if you know right how to fix it, will be faster for you to submit. Thanks.

bretg avatar Jun 14 '24 14:06 bretg

Thanks for looking into it. Let me create a PR with the fix.

az-auddin avatar Jun 19 '24 08:06 az-auddin

Fix will be part of https://github.com/prebid/prebid-server-java/pull/3440

Compile-Ninja avatar Sep 12 '24 14:09 Compile-Ninja