Skip to content

Commit

Permalink
[frontend] Fix counter_redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kang committed Jun 21, 2018
1 parent f77d0e4 commit a299d1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api/app/models/obs_factory/openqa_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _get(uri, counter_redirects)
# Prevent endless loop in case response is always 301 or 302
unless counter_redirects >= 5
if resp.code.to_i == 302 or resp.code.to_i == 301
counter_redirects =+ 1
counter_redirects += 1
Rails.logger.debug "following to #{resp.header['location']}"
return _get(URI.parse(resp.header['location']), counter_redirects)
end
Expand All @@ -47,7 +47,7 @@ def get(url, params = {}, options = {})
end

if options[:base_url]
uri = URI.join(options[:base_url].chomp('/')+'/', url)
uri = URI.join(options[:base_url].chomp('/') + '/', url)
else
uri = URI.join(@base_url, url)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def review_percentage
total = classified_requests.size
missing = 0
classified_requests.each do |rq|
missing +=1 if rq[:missing_reviews]
missing += 1 if rq[:missing_reviews]
end
if total > 0
100 - missing * 100 / total
Expand Down

0 comments on commit a299d1c

Please sign in to comment.