fix: add user agent to phishtank request

https://phishtank.org/developer_info.php
This commit is contained in:
MDLeom 2022-10-10 09:13:39 +00:00
parent c523b653bb
commit 93824af81b
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 11 additions and 2 deletions

View File

@ -35,11 +35,20 @@ fi
mkdir -p "tmp/"
cd "tmp/"
USER_AGENT="phishtank/malware-filter"
if [ -n "$GITLAB_USER_LOGIN" ]; then
USER_AGENT="phishtank/$GITLAB_USER_LOGIN"
elif [ -n "$GITHUB_REPOSITORY_OWNER" ]; then
USER_AGENT="phishtank/$GITHUB_REPOSITORY_OWNER"
fi
## Prepare datasets
if [ -n "$PHISHTANK_API" ]; then
curl -L "https://data.phishtank.com/data/$PHISHTANK_API/online-valid.csv.bz2" -o "phishtank.bz2"
curl -L --user-agent "$USER_AGENT" \
"https://data.phishtank.com/data/$PHISHTANK_API/online-valid.csv.bz2" -o "phishtank.bz2"
else
curl -L "https://data.phishtank.com/data/online-valid.csv.bz2" -o "phishtank.bz2"
curl -L --user-agent "$USER_AGENT" \
"https://data.phishtank.com/data/online-valid.csv.bz2" -o "phishtank.bz2"
fi
curl -L "https://openphish.com/feed.txt" -o "openphish-raw.txt"