Pull request: all: imp code, err handling

Closes .

Squashed commit of the following:

commit a5b50ee011a995f4ab3d93314acd6f0ca82d99cf
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Mon Mar 15 14:05:25 2021 +0300

    all: imp code

commit bc610f8f438549e8c6b04c8a213b5422dda2aff5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Fri Mar 12 20:00:14 2021 +0300

    all: imp code, err handling
This commit is contained in:
Ainar Garipov 2021-03-15 14:19:04 +03:00
parent d970b79f2b
commit 313fd7107f
15 changed files with 121 additions and 99 deletions
internal/home

View file

@ -570,8 +570,8 @@ func loadOptions() options {
return o
}
// prints IP addresses which user can use to open the admin interface
// proto is either "http" or "https"
// printHTTPAddresses prints the IP addresses which user can use to open the
// admin interface. proto is either schemeHTTP or schemeHTTPS.
func printHTTPAddresses(proto string) {
tlsConf := tlsConfigSettings{}
if Context.tls != nil {
@ -579,12 +579,12 @@ func printHTTPAddresses(proto string) {
}
port := strconv.Itoa(config.BindPort)
if proto == "https" {
if proto == schemeHTTPS {
port = strconv.Itoa(tlsConf.PortHTTPS)
}
var hostStr string
if proto == "https" && tlsConf.ServerName != "" {
if proto == schemeHTTPS && tlsConf.ServerName != "" {
if tlsConf.PortHTTPS == 443 {
log.Printf("Go to https://%s", tlsConf.ServerName)
} else {