// TestDeniedBlockHosts adds a host to the block list and then immediately attempts to make
// a request to that host, which should be denied by procrastiproxy
TestDeniedBlockHosts adds a host to the block list and then immediately attempts to make
a request to that host, which should be denied by procrastiproxy
// TestDeniedBlockHosts adds a host to the block list and then immediately attempts to make // a request to that host which should be denied by procrastiproxy
func TestDeniesBlockedHost(t *testing.T) {
	client, backend, err := setupTestServer(t)
	defer backend.Close()
	if err != nil {
		t.Fatal(err)
	}
	blockedHost := "reddit.com"
	testURL := "http://reddit.com"
	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.StatusForbidden {
		t.Logf("Wanted HTTP StatusCode: %d for URL: %s but got: %d\n", http.StatusForbidden, testURL, res.StatusCode)
		t.Fail()
	}
}
func TestDeniesBlockedHost ( 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 . StatusForbidden { t . Logf ( " \n " , http . StatusForbidden , testURL , res . StatusCode ) t . Fail ( ) } }
TestDeniedBlockHosts adds a host to the block list and then immediately attempts to make
a request to that host, which should be denied by procrastiproxy
TestDeniedBlockHosts adds a host to the block list and then immediately attempts to make a request to that host which should be denied by procrastiproxy