Browse Source

fix: change target max length to 2040.

Closes #222
upstream-develop
poeti8 1 year ago
parent
commit
f6d566f33d
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      server/controllers/validateBodyController.ts
  2. +1
    -1
      server/models/link.ts

+ 2
- 2
server/controllers/validateBodyController.ts View File

@ -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 View File

@ -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")


Loading…
Cancel
Save