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

inspec compliance login: Ensure supplied server has a proper URI scheme #2268

Merged
merged 1 commit into from
Oct 27, 2017

Conversation

jerryaldrichiii
Copy link
Contributor

An issue was discovered whereby a user logging in with inspec compliance login did not specify https:// in their SERVER argument. This causes https://github.com/chef/inspec/blob/master/lib/fetchers/url.rb#L146 to fail because https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb#L33 doesn't interpret the option as a URL.

This adds https:// to the front of options['server'] if the URI doesn't contain a scheme, thus fixing the issue.

This allows a user to specify an Automate server without prepending
`https://`. Without this, anything using the `url` fetcher will fail
because `open` doesn't interpret the argument as a URL.

Signed-off-by: Jerry Aldrich <[email protected]>
@adamleff adamleff changed the title Force https scheme for inspec compliance login inspec compliance login: Ensure supplied server has a proper URI scheme Oct 26, 2017
@adamleff adamleff added the Type: Bug Feature not working as expected label Oct 26, 2017
@adamleff adamleff requested a review from a team October 26, 2017 21:50
Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Thank you @jerryaldrichiii

@chris-rock chris-rock merged commit 94a79b2 into master Oct 27, 2017
@chris-rock chris-rock deleted the ja/fix-login-https branch October 27, 2017 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants