isInsecureSubURL reports whether subURL would expose the request over plaintext. Non-http(s) URLs (e.g. malformed input) are treated as insecure too — they'll fail downstream anyway, but the conservative answer avoids ever sending HWID to a non-https endpoint by mistake.
(subURL string)
| 2025 | // insecure too — they'll fail downstream anyway, but the conservative |
| 2026 | // answer avoids ever sending HWID to a non-https endpoint by mistake. |
| 2027 | func isInsecureSubURL(subURL string) bool { |
| 2028 | low := strings.ToLower(strings.TrimSpace(subURL)) |
| 2029 | return !strings.HasPrefix(low, "https://") |
| 2030 | } |
| 2031 | |
| 2032 | // fetchSubscriptionFromURL fetches and parses a subscription. allowInsecure |
| 2033 | // must be true to accept http:// URLs; when set, we also suppress the |
no outgoing calls
no test coverage detected