fix: added temporary blacklist (#399)

This commit is contained in:
Anurag Hazra 2020-08-17 14:18:17 +05:30 committed by GitHub
parent c05357d7b2
commit 6fa8c26754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 0 deletions

View File

@ -8,6 +8,7 @@ const {
} = require("../src/common/utils");
const fetchStats = require("../src/fetchers/stats-fetcher");
const renderStatsCard = require("../src/cards/stats-card");
const blacklist = require("../src/common/blacklist");
module.exports = async (req, res) => {
const {
@ -31,6 +32,10 @@ module.exports = async (req, res) => {
res.setHeader("Content-Type", "image/svg+xml");
if (blacklist.includes(username)) {
return res.send(renderError("Something went wrong"));
}
try {
stats = await fetchStats(
username,

View File

@ -7,6 +7,7 @@ const {
} = require("../src/common/utils");
const fetchRepo = require("../src/fetchers/repo-fetcher");
const renderRepoCard = require("../src/cards/repo-card");
const blacklist = require("../src/common/blacklist");
module.exports = async (req, res) => {
const {
@ -25,6 +26,10 @@ module.exports = async (req, res) => {
res.setHeader("Content-Type", "image/svg+xml");
if (blacklist.includes(username)) {
return res.send(renderError("Something went wrong"));
}
try {
repoData = await fetchRepo(username, repo);

View File

@ -8,6 +8,7 @@ const {
} = require("../src/common/utils");
const fetchTopLanguages = require("../src/fetchers/top-languages-fetcher");
const renderTopLanguages = require("../src/cards/top-languages-card");
const blacklist = require("../src/common/blacklist");
module.exports = async (req, res) => {
const {
@ -27,6 +28,10 @@ module.exports = async (req, res) => {
res.setHeader("Content-Type", "image/svg+xml");
if (blacklist.includes(username)) {
return res.send(renderError("Something went wrong"));
}
try {
topLangs = await fetchTopLanguages(username);

3
src/common/blacklist.js Normal file
View File

@ -0,0 +1,3 @@
const blacklist = ["renovate-bot", "technote-space", "sw-yx"];
module.exports = blacklist;