mirror of
https://github.com/alexgo-io/stacks-blockchain-api.git
synced 2026-01-12 22:43:34 +08:00
fix: revert to 404 error code on bns name errors (#1440)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user