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

Replace outdated rest-client with httprb and update oauth2 dependency #160

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stevenjcumming
Copy link

Summary

  • Remove rest-client
  • Add httprb
  • Update 'oauth2' dependency to '>= 1.1'

@@ -39,6 +56,7 @@ class Client
# @return
#
def initialize(base_service_url, default_format: FHIR::Formats::ResourceFormat::RESOURCE_JSON, proxy: nil)
base_service_url = "http://#{base_service_url}" unless base_service_url.start_with?("https://", "http://")

Choose a reason for hiding this comment

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

Instead of dealing with these URLS as strings to be manipulated and mutated, what do you think about using the ruby URI object?

uri = URI.parse(base_service_url)

# Check if the scheme is missing
if uri.scheme.nil?
  # Construct a new URI with the "http" scheme
  uri = URI::HTTP.build(host: uri.host, path: uri.path)
end
@base_service_url = uri

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

Successfully merging this pull request may close these issues.

2 participants