Эх сурвалжийг харах

fix: change target max length to 2040.

Closes #222
poeti8 6 жил өмнө
parent
commit
f6d566f33d

+ 2 - 2
server/controllers/validateBodyController.ts

@@ -72,8 +72,8 @@ export const validateUrl: RequestHandler = async (req, res, next) => {
     return res.status(400).json({ error: "No target has been provided." });
 
   // validate URL length
-  if (req.body.target.length > 1023) {
-    return res.status(400).json({ error: "Maximum URL length is 1023." });
+  if (req.body.target.length > 2040) {
+    return res.status(400).json({ error: "Maximum URL length is 2040." });
   }
 
   // Validate URL

+ 1 - 1
server/models/link.ts

@@ -20,7 +20,7 @@ export async function createLinkTable(knex: Knex) {
         .references("id")
         .inTable("domains");
       table.string("password");
-      table.string("target", 1023).notNullable();
+      table.string("target", 2040).notNullable();
       table
         .integer("user_id")
         .references("id")