feat: implement whitelist for self-hosted instances (#3939)
* whitelist for username based endpoints * added gist whitelist * review * fix --------- Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
+5
-1
@@ -307,7 +307,11 @@ describe("Test /api/", () => {
|
||||
|
||||
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
|
||||
expect(res.send).toBeCalledWith(
|
||||
renderError("Something went wrong", "This username is blacklisted"),
|
||||
renderError(
|
||||
"This username is blacklisted",
|
||||
"Please deploy your own instance",
|
||||
{ show_repo_link: false },
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
+5
-1
@@ -156,7 +156,11 @@ describe("Test /api/pin", () => {
|
||||
|
||||
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
|
||||
expect(res.send).toBeCalledWith(
|
||||
renderError("Something went wrong", "This username is blacklisted"),
|
||||
renderError(
|
||||
"This username is blacklisted",
|
||||
"Please deploy your own instance",
|
||||
{ show_repo_link: false },
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -184,7 +184,11 @@ describe("Test /api/top-langs", () => {
|
||||
|
||||
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
|
||||
expect(res.send).toBeCalledWith(
|
||||
renderError("Something went wrong", "This username is blacklisted"),
|
||||
renderError(
|
||||
"This username is blacklisted",
|
||||
"Please deploy your own instance",
|
||||
{ show_repo_link: false },
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user