mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
capture numeric httpstatuscode
This commit is contained in:
parent
f42470896a
commit
cb3f9b2d65
2 changed files with 3 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
#sshpass -p $FTP_PASSWORD ssh -o StrictHostKeyChecking=no $FTP_USER@$FTP_HOST:$FTP_DIR 'rm -rf !(appsettings.json)'
|
||||
#purge target directory: rm -rf !(appsettings.json)
|
||||
sshpass -p $FTP_PASSWORD scp -o StrictHostKeyChecking=no -r /home/travis/build/collinbarrett/FilterLists/data/ $FTP_USER@$FTP_HOST:$FTP_DIR
|
||||
chmod 777 /home/travis/build/collinbarrett/FilterLists/src/FilterLists.Agent/bin/Release/netcoreapp2.0/ubuntu.16.04-x64/publish/FilterLists.Agent
|
||||
sshpass -p $FTP_PASSWORD scp -o StrictHostKeyChecking=no -r /home/travis/build/collinbarrett/FilterLists/src/FilterLists.Agent/bin/Release/netcoreapp2.0/ubuntu.16.04-x64/publish/* $FTP_USER@$FTP_HOST:$FTP_DIR
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ private async Task<string> TryGetContent()
|
|||
}
|
||||
catch (WebException we)
|
||||
{
|
||||
snapshot.HttpStatusCode = ((HttpWebResponse)we.Response).StatusCode.ToString();
|
||||
snapshot.HttpStatusCode = ((int)((HttpWebResponse)we.Response).StatusCode).ToString();
|
||||
return null;
|
||||
}
|
||||
catch (HttpRequestException)
|
||||
|
|
@ -73,7 +73,7 @@ private async Task<string> GetContent()
|
|||
using (var httpClient = new HttpClient())
|
||||
using (var httpResponseMessage = await httpClient.GetAsync(list.ViewUrl))
|
||||
{
|
||||
snapshot.HttpStatusCode = httpResponseMessage.StatusCode.ToString();
|
||||
snapshot.HttpStatusCode = ((int)httpResponseMessage.StatusCode).ToString();
|
||||
if (httpResponseMessage.IsSuccessStatusCode)
|
||||
return await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue