small improvement + better error handling

This commit is contained in:
daniel31x13
2023-12-31 07:55:45 -05:00
parent dea1e12700
commit e872c25332
5 changed files with 14 additions and 4 deletions
+4 -1
View File
@@ -68,7 +68,10 @@ export default async function postLink(
const validatedUrl = link.url ? await validateUrlSize(link.url) : undefined;
if (validatedUrl === null)
return { response: "File is too large to be stored.", status: 400 };
return {
response: "Something went wrong while retrieving the file size.",
status: 400,
};
const contentType = validatedUrl?.get("content-type");
let linkType = "url";