Skip to content

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

Open
stevenjcumming wants to merge 3 commits into
inferno-framework:masterfrom
adhocteam:master
Open

Replace outdated rest-client with httprb and update oauth2 dependency #160
stevenjcumming wants to merge 3 commits into
inferno-framework:masterfrom
adhocteam:master

Conversation

@stevenjcumming

Copy link
Copy Markdown

Summary

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

Comment thread lib/fhir_client/client.rb
# @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://")

Copy link
Copy Markdown

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