Skip to content

Commit

Permalink
Some update
Browse files Browse the repository at this point in the history
  • Loading branch information
sefinek committed Nov 23, 2024
1 parent 8f531aa commit 78ee2ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ const appendToFile = async (filePath, content) => {
if (!apiKey) throw new Error('MALICIOUS_IPS_LIST_SECRET environment variable not set');

const res = await axios.get('https://api.sefinek.net/api/v2/cloudflare-waf-abuseipdb/get', {
headers: {
'Authorization': apiKey,
'User-Agent': `Mozilla/5.0 (compatible; Malicious-IP-Addresses/${version}; +https://github.com/sefinek/Malicious-IP-Addresses)`,
},
headers: { 'Authorization': apiKey },
});

const data = res.data?.logs || [];
Expand Down
4 changes: 2 additions & 2 deletions scripts/services/axios.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const axios = require('axios');
const { name, version } = require('../../package.json');
const { version } = require('../../package.json');

axios.defaults.headers.common = {
'User-Agent': `Mozilla/5.0 (compatible; ${name}/${version}; +https://github.com/sefinek/Malicious-IP-Addresses)`,
'User-Agent': `Mozilla/5.0 (compatible; Malicious-IP-Addresses/${version}; +https://github.com/sefinek/Malicious-IP-Addresses)`,
'Accept': 'application/json',
'Content-Type': 'application/json',
'Accept-Encoding': 'gzip, deflate, br',
Expand Down

0 comments on commit 78ee2ba

Please sign in to comment.