diff --git a/client/handler.go b/client/handler.go index c62e8fac4..c61967c69 100644 --- a/client/handler.go +++ b/client/handler.go @@ -33,20 +33,6 @@ func (client *Client) handle(conn net.Conn) error { return err } -func normalizeExoAd(req *http.Request) (*http.Request, bool) { - host, _, err := net.SplitHostPort(req.Host) - if err != nil { - host = req.Host - } - if strings.HasSuffix(host, ".exdynsrv.com") { - qvals := req.URL.Query() - qvals.Set("p", "https://www.getlantern.org/") - req.URL.RawQuery = qvals.Encode() - return req, true - } - return req, false -} - func (client *Client) filter(cs *filters.ConnectionState, req *http.Request, next filters.Next) (*http.Response, *filters.ConnectionState, error) { if client.isHTTPProxyPort(req) { log.Debugf("Reject proxy request to myself: %s", req.Host) diff --git a/client/handler_test.go b/client/handler_test.go index c9b60d48d..78be510c6 100644 --- a/client/handler_test.go +++ b/client/handler_test.go @@ -16,27 +16,6 @@ import ( "github.com/getlantern/httpseverywhere" ) -func TestNormalizeExoAd(t *testing.T) { - doTestNormalizeExoAd(t, "syndication.exdynsrv.com") - doTestNormalizeExoAd(t, "syndication.exdynsrv.com:80") - doTestNormalizeExoAd(t, "syndication.exdynsrv.com:443") - - req, _ := http.NewRequest("GET", "http://exdynsrv.com.friendlygfw.cn", nil) - _, ad := normalizeExoAd(req) - assert.False(t, ad) -} - -func doTestNormalizeExoAd(t *testing.T, host string) { - req, _ := http.NewRequest("GET", "http://"+host, nil) - qvals := req.URL.Query() - qvals.Set("p", "https://www.somethingelse.com") - req.URL.RawQuery = qvals.Encode() - - req2, ad := normalizeExoAd(req) - assert.True(t, ad) - assert.Equal(t, "https://www.getlantern.org/", req2.URL.Query().Get("p")) -} - func TestRewriteHTTPSSuccess(t *testing.T) { client := newClient() client.rewriteToHTTPS = httpseverywhere.Eager()