Skip to content

Commit 6445b23

Browse files
committed
ensure http response is from cloudflare
1 parent 0d21924 commit 6445b23

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

fast cf ip scanner/Services/IPService.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public async Task<List<IPModel>> GetIpValid(string[] ips, IpOptionModel ipOption
2121
var validIps = new List<IPModel>();
2222
switch (protcol)
2323
{
24-
case "Http test":
24+
case "Http test (recommended)":
2525
validIps = await GetValidٌIPWithHttpTest(ips, ipOptions);
2626
break;
2727

@@ -73,9 +73,12 @@ async Task HttpTest(string ipAddresse)
7373

7474
if (result != null)
7575
{
76-
if (!ports.Any(p => p == port))
76+
if (result.Headers.Contains("Server") && result.Headers.GetValues("Server").Contains("cloudflare"))
7777
{
78-
ports.Add(port);
78+
if (!ports.Any(p => p == port))
79+
{
80+
ports.Add(port);
81+
}
7982
}
8083
}
8184
}

fast cf ip scanner/ViewModels/ScanPageViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public ScanPageViewModel(IPService iPServices, WorkerService workerService)
3434
[RelayCommand]
3535
async void GetValidIPs()
3636
{
37-
var protocols = new string[] { "Http test", "TCP test", "Terminal Ping test" };
37+
var protocols = new string[] { "Http test (recommended)", "TCP test", "Terminal Ping test" };
3838

3939
var selectedProtocol =
4040
await App.Current.MainPage.DisplayActionSheet("which protocol", "Cancel", null, protocols);

0 commit comments

Comments
 (0)