constructServerURL builds a server URL from protocol, host, and port. Omits port for default ports (80 for http, 443 for https).
(protocol, host string, port int)
| 775 | // constructServerURL builds a server URL from protocol, host, and port. |
| 776 | // Omits port for default ports (80 for http, 443 for https). |
| 777 | func constructServerURL(protocol, host string, port int) string { |
| 778 | proto := strings.ToLower(protocol) |
| 779 | if (proto == "https" && port == 443) || (proto == "http" && port == 80) { |
| 780 | return proto + "://" + host |
| 781 | } |
| 782 | return proto + "://" + host + ":" + strconv.Itoa(port) |
| 783 | } |
| 784 | |
| 785 | func applySettingsUpdate(s *models.Settings, req map[string]interface{}, enc *util.Encryption) { |
| 786 | urlVal, hasExplicitURL := getReqString(req, "server_url", "serverUrl") |
no outgoing calls
no test coverage detected