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

Allow connecting to localhost without https. #185

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion panoptes_cli/commands/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def configure(ctx, edit_all):
show_default=not is_password,
)

if not ctx.parent.config['endpoint'].startswith('https://'):
# If not connecting to local host (e.g. panoptes running locally)
# and endpoint is not https, refuse connection!
if ('localhost' not in ctx.parent.config['endpoint']
and not ctx.parent.config['endpoint'].startswith('https://')):
Copy link

Choose a reason for hiding this comment

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

visually indented line with same indent as next logical line

Copy link
Author

Choose a reason for hiding this comment

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

click.echo(
'Error: Invalid endpoint supplied. Endpoint must be an HTTPS URL.'
)
Expand Down