Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
feat: follow redirects in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseySaari committed Mar 10, 2022
2 parents b992537 + 92d072c commit cb8143d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/argo_cd/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def get_app_info(uri)
https.verify_mode = OpenSSL::SSL::VERIFY_NONE if Rails.env.development?
response = https.get(uri, request_headers)

if Rails.env.production?
response = Net::HTTP.get_response(URI.parse(response['location']))
end

Response.new(response: response)
end

Expand Down Expand Up @@ -63,6 +67,11 @@ def generate_token
request = build_request(uri)

r = https.request(request)

if Rails.env.production?
r = Net::HTTP.get_response(URI.parse(r['location']))
end

response = Response.new(response: r)

save_token(response) if response.successful?
Expand Down

0 comments on commit cb8143d

Please sign in to comment.