Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Follow redirects for script/github_pr_errors

Christophe Bliard0f56928b4930
diff --git a/script/github_pr_errors b/script/github_pr_errors
index 68c590c0894..a140ade72a4 100755
--- a/script/github_pr_errors
+++ b/script/github_pr_errors
@@ -11,6 +11,7 @@ require 'pathname'
require 'pry'
require 'yaml'
require 'faraday'
+require 'faraday/follow_redirects'
GITHUB_API_OPENPROJECT_PREFIX = 'https://api.github.com/repos/opf/openproject'.freeze
GITHUB_HTML_OPENPROJECT_PREFIX = 'https://github.com/opf/openproject'.freeze
@@ -100,7 +101,7 @@ class Options
end
parser.on("-v", "--verbose",
- "Print more information, mostly useful for debugging") do |value|
+ "Print more information, mostly useful for debugging") do
options[:verbose] = true
end
end
@@ -132,6 +133,7 @@ def get_http(path)
say_verbose("HTTP GET #{url}")
conn = Faraday.new do |faraday|
+ faraday.response :follow_redirects # use Faraday::FollowRedirects::Middleware
faraday.response :raise_error # raise Faraday::Error on status code 4xx or 5xx
end