Skip to content

Commit cdc039c

Browse files
authored
fix: revert to 404 error code on bns name errors (#1440)
1 parent e00efd4 commit cdc039c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/api/routes/bns/names.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export function createBnsNamesRouter(db: PgStore, chainId: ChainID): express.Rou
161161
if (error instanceof NameRedirectError) {
162162
res.redirect(error.message);
163163
} else {
164-
res.status(400).json(error);
164+
res.status(404).json(error);
165165
}
166166
});
167167
})

src/tests-bns/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ describe('BNS API tests', () => {
737737

738738
test('Failure: name info', async () => {
739739
const query1 = await supertest(api.server).get(`/v1/names/testname`);
740-
expect(query1.status).toBe(400);
740+
expect(query1.status).toBe(404);
741741
});
742742

743743
test('Success: fetching name info', async () => {

src/tests-bns/bns-integration-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ describe('BNS integration tests', () => {
436436
expect(query4.status).toBe(200);
437437

438438
const query5 = await supertest(api.server).get(`/v1/names/excluded.${name}.${namespace}`);
439-
expect(query5.status).toBe(400);
439+
expect(query5.status).toBe(404);
440440
expect(query5.type).toBe('application/json');
441441

442442
// testing nameupdate 3

0 commit comments

Comments
 (0)