Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisableRedirectHandling in JenkinsHttpClient #235

Open
amcginn opened this issue Feb 24, 2017 · 2 comments
Open

DisableRedirectHandling in JenkinsHttpClient #235

amcginn opened this issue Feb 24, 2017 · 2 comments

Comments

@amcginn
Copy link
Contributor

amcginn commented Feb 24, 2017

When calling a GET for job//<build#>/toggleLogKeep, I get an exception thrown:
org.apache.http.client.CircularRedirectException: Circular redirect to 'https:///job//<build#>/toggleLogKeep/api/'

If I edit the source code in JenkinsHttpClient.addAuthentication(HttpClientBuilder builder, URI uri, String username, String password) to add HttpClientBuilder.disableRedirectHandling(), this prevents the Exception from being thrown and allows me to toggle the "Keep build forever" functionality.

@khmarbaise
Copy link
Member

But that means your environment makes such redirection...and not the api. The api only follows the redirect...Apart from that you could also offer a patch to improve that handling in java-client-api ?

@amcginn
Copy link
Contributor Author

amcginn commented Jun 19, 2017

True, the Jenkins API is causing the cyclical redirect. Updating the HttpClientBuilder in the java-client-api to ignore redirects will prevent the exception from being thrown in these situations. Opened #266 for this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants