fix: revert to 404 error code on bns name errors (#1440)

This commit is contained in:
Rafael Cárdenas
2022-11-15 12:14:34 -06:00
committed by GitHub
parent e00efd4e64
commit cdc039cea8
3 changed files with 3 additions and 3 deletions

View File

@@ -161,7 +161,7 @@ export function createBnsNamesRouter(db: PgStore, chainId: ChainID): express.Rou
if (error instanceof NameRedirectError) {
res.redirect(error.message);
} else {
res.status(400).json(error);
res.status(404).json(error);
}
});
})

View File

@@ -737,7 +737,7 @@ describe('BNS API tests', () => {
test('Failure: name info', async () => {
const query1 = await supertest(api.server).get(`/v1/names/testname`);
expect(query1.status).toBe(400);
expect(query1.status).toBe(404);
});
test('Success: fetching name info', async () => {

View File

@@ -436,7 +436,7 @@ describe('BNS integration tests', () => {
expect(query4.status).toBe(200);
const query5 = await supertest(api.server).get(`/v1/names/excluded.${name}.${namespace}`);
expect(query5.status).toBe(400);
expect(query5.status).toBe(404);
expect(query5.type).toBe('application/json');
// testing nameupdate 3