// TestAllowsWhitelistedHost ensures that a host that has not been explicitly blocked
// can be reached through procrastiproxy
TestAllowsWhitelistedHost ensures that a host that has not been explicitly blocked
can be reached through procrastiproxy
// TestAllowsWhitelistedHost ensures that a host that has not been explicitly blocked // can be reached through procrastiproxy
func TestAllowsWhitelistedHost(t *testing.T) {
	client, backend, err := setupTestServer(t)
	defer backend.Close()
	if err != nil {
		t.Fatal(err)
	}
	blockedHost := "nytimes.com"
	testURL := "http://wikipedia.org"
	AddHostToBlockList(blockedHost)
	res, err := client.Get(testURL)
	if err != nil {
		t.Fatalf("Error attempting to fetch test server URL: %v\n", err)
	}
	if res.StatusCode != http.StatusOK {
		t.Logf("Wanted HTTP StatusCode: %d for URL: %s but got: %d\n", http.StatusOK, testURL, res.StatusCode)
		t.Fail()
	}
}
func TestAllowsWhitelistedHost ( t * testing . T ) { client , backend , err := setupTestServer ( t ) defer backend . Close ( ) if err != nil { t . Fatal ( err ) } blockedHost := " " testURL := " " AddHostToBlockList ( blockedHost ) res , err := client . Get ( testURL ) if err != nil { t . Fatalf ( " \n " , err ) } if res . StatusCode != http . StatusOK { t . Logf ( " \n " , http . StatusOK , testURL , res . StatusCode ) t . Fail ( ) } }
TestAllowsWhitelistedHost ensures that a host that has not been explicitly blocked
can be reached through procrastiproxy
TestAllowsWhitelistedHost ensures that a host that has not been explicitly blocked can be reached through procrastiproxy
// Set the blocked hosts config variable that is used by the proxy backend