Skip to content

Commit 0d7ffcc

Browse files
committed
fix: statusCode
1 parent 1df2a39 commit 0d7ffcc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared/utils/npm.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export function assertValidPackageName(name: string): void {
5757
export function assertValidUsername(username: string): void {
5858
if (!username || username.length > NPM_USERNAME_MAX_LENGTH || !NPM_USERNAME_RE.test(username)) {
5959
throw createError({
60-
statusCode: 400,
60+
// TODO: throwing 404 rather than 400 as it's cacheable
61+
statusCode: 404,
6162
message: `Invalid username: ${username}`,
6263
})
6364
}

0 commit comments

Comments
 (0)