diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-01-02 15:03:30 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-01-02 15:03:30 +0100 |
| commit | c5f90fd552a70f2a5b2f23c9371e011e5c6e0e94 (patch) | |
| tree | 4c4242fea6d9c11aa9fe6c0050073035220b3b41 | |
| parent | 18d8f06226e7d1ef4c6f2023f246f7cb0cf8783d (diff) | |
Discovery: Allow overriding Disco URL
| -rw-r--r-- | internal/discovery/discovery.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go index 487d39a..d68b3ba 100644 --- a/internal/discovery/discovery.go +++ b/internal/discovery/discovery.go @@ -21,12 +21,13 @@ type Discovery struct { servers types.DiscoveryServers } +var DiscoURL string = "https://disco.eduvpn.org/v2/" + // discoFile is a helper function that gets a disco JSON and fills the structure with it // If it was unsuccessful it returns an error. func discoFile(jsonFile string, previousVersion uint64, structure interface{}) error { // Get json data - URL := "https://disco.eduvpn.org/v2/" - jsonURL := URL + jsonFile + jsonURL := DiscoURL + jsonFile _, body, err := http.Get(jsonURL) if err != nil { return err @@ -34,7 +35,7 @@ func discoFile(jsonFile string, previousVersion uint64, structure interface{}) e // Get signature sigFile := jsonFile + ".minisig" - sigURL := URL + sigFile + sigURL := DiscoURL + sigFile _, sigBody, err := http.Get(sigURL) if err != nil { return err |
