From c5f90fd552a70f2a5b2f23c9371e011e5c6e0e94 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 2 Jan 2023 15:03:30 +0100 Subject: Discovery: Allow overriding Disco URL --- internal/discovery/discovery.go | 7 ++++--- 1 file 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 -- cgit v1.2.3