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

Manually follow http redirect when needed #507

Merged
merged 2 commits into from
May 25, 2021

Conversation

pawoolley
Copy link
Contributor

@pawoolley pawoolley commented May 25, 2021

While trying to run the jenkinsfile-runner from the command line, without the extra -w option to point to a war file, I noticed that the app tried to download the latest jenkins.war but fails because the target url of http://updates.jenkins.io/download/war/2.277.4/jenkins.war redirects across schemes (http -> https) to https://get.jenkins.io/war-stable/2.277.4/jenkins.war. This jump of schemes is not handle automatically by Java's HttpURLConnection and must be dealt with manually.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@pawoolley pawoolley requested a review from a team as a code owner May 25, 2021 10:26
@oleg-nenashev oleg-nenashev added the enhancement New feature or request label May 25, 2021
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. IIUC it will not follow multiple redirects

@pawoolley
Copy link
Contributor Author

pawoolley commented May 25, 2021

Looks good. IIUC it will not follow multiple redirects

If there were a chain of redirects that went http -> https -> http, then no, this change would not handle that, but it's good enough for the purposes of the http -> https change that happens when downloading the jenkins.war file. And it should be good enough for any redirects that happen where the http(s) scheme remains the same.

@pawoolley
Copy link
Contributor Author

Btw, @oleg-nenashev, I don't have permissions to merge this now that it has all green ticks. Is that something you do, or someone can give me the permission to do?

@oleg-nenashev
Copy link
Member

I will merge it. When do you need a release? This repo does not have CD at the moment?

@oleg-nenashev oleg-nenashev merged commit 4f1c92a into jenkinsci:master May 25, 2021
@pawoolley
Copy link
Contributor Author

I will merge it. When do you need a release? This repo does not have CD at the moment?

Ah, ok. I don't need a release any time soon. Was just curious as to what the process was.

@pawoolley pawoolley deleted the handle-redirect branch May 25, 2021 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants