Skip to content

Commit 8e85cbb

Browse files
committed
customisable max paste id length
1 parent 1fdb6f6 commit 8e85cbb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const app = express();
66

77
const port = process.env.PORT || 3000;
88
const softdeletion = process.env.softdeletion || true;
9+
const maxPasteIDLength = process.env.maxpasteidlength || 10;
910
const agent = new https.Agent({ rejectUnauthorized: false }); // Disable SSL verification
1011

1112

@@ -20,7 +21,7 @@ const sanitizeId = (id) => {
2021
return "ERR-INVALID-ID"
2122

2223
}
23-
if (sanitized.length > 50) {
24+
if (sanitized.length >= maxPasteIDLength) {
2425
return "ERR-TOO-LONG-ID"
2526
}
2627
return sanitized;

0 commit comments

Comments
 (0)