Skip to content

Commit 33a7932

Browse files
committed
Whitelisting staging config URL
1 parent 67d94d7 commit 33a7932

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/github.com/getlantern/flashlight/config/config.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ package config
33
import (
44
"crypto/x509"
55
"fmt"
6-
"net/url"
76
"os"
87
"path/filepath"
98
"regexp"
109
"sort"
1110
"time"
1211

1312
"github.com/getlantern/appdir"
14-
"github.com/getlantern/detour"
1513
"github.com/getlantern/fronted"
1614
"github.com/getlantern/golog"
1715
"github.com/getlantern/keyman"
@@ -53,14 +51,6 @@ type Config struct {
5351

5452
// StartPolling starts the process of polling for new configuration files.
5553
func StartPolling() {
56-
// Force detour to whitelist chained domain
57-
u, err := url.Parse(defaultChainedCloudConfigURL)
58-
if err != nil {
59-
log.Fatalf("Unable to parse chained cloud config URL: %v", err)
60-
}
61-
log.Debugf("Polling at %v", defaultChainedCloudConfigURL)
62-
detour.ForceWhitelist(u.Host)
63-
6454
// No-op if already started.
6555
m.StartPolling()
6656
}

src/github.com/getlantern/flashlight/config/fetcher.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import (
77
"math/rand"
88
"net/http"
99
"net/http/httputil"
10+
"net/url"
1011
"strconv"
1112
"time"
1213

14+
"github.com/getlantern/detour"
1315
"github.com/getlantern/yamlconf"
1416

1517
"code.google.com/p/go-uuid/uuid"
@@ -85,6 +87,15 @@ func NewFetcher(conf UserConfig, rt http.RoundTripper, flags map[string]interfac
8587
}
8688
}
8789

90+
log.Debugf("Will poll for config at %v (%v)", chained, fronted)
91+
92+
// Force detour to whitelist chained domain
93+
u, err := url.Parse(chained)
94+
if err != nil {
95+
log.Fatalf("Unable to parse chained cloud config URL: %v", err)
96+
}
97+
detour.ForceWhitelist(u.Host)
98+
8899
return &fetcher{
89100
lastCloudConfigETag: map[string]string{},
90101
user: conf,

0 commit comments

Comments
 (0)