Skip to content

Instantly share code, notes, and snippets.

@rogpeppe
Created September 11, 2017 07:33
Show Gist options
  • Save rogpeppe/1b9c92de93c75595bbb0af1bd9c59128 to your computer and use it in GitHub Desktop.
Save rogpeppe/1b9c92de93c75595bbb0af1bd9c59128 to your computer and use it in GitHub Desktop.
// isHTTPS reports whether the configuration
// is configured to use HTTPS.
func (config Config) isHTTPS() bool {
// Ignore any URL parsing error as that'll
// be handled by other code paths.
configURL, _ := url.Parse(config.URL)
return configURL != nil && configURL.Scheme == "https"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment