From bcb9740d89b0a59911a58eadea822b3ee7bef37d Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Sat, 2 Dec 2023 15:27:58 -0500 Subject: [PATCH] (core) update tests and endpoints after bare /urlId redirect added Summary: * Some tests needed updating because fake document ids in tests were changed to be valid urlIds (the existing ones were too short). * urlId capture is tweaked to not allow hyphens, so some long login-related paths don't get confused with documents. Test Plan: tests should pass again Reviewers: dsagal Reviewed By: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D4134 --- app/server/lib/AppEndpoint.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/server/lib/AppEndpoint.ts b/app/server/lib/AppEndpoint.ts index 937303c7..4f40ada7 100644 --- a/app/server/lib/AppEndpoint.ts +++ b/app/server/lib/AppEndpoint.ts @@ -212,6 +212,6 @@ export function attachAppEndpoint(options: AttachOptions): void { // The * is a wildcard in express 4, rather than a regex symbol. // See https://expressjs.com/en/guide/routing.html app.get('/doc/:urlId([^/]+):remainder(*)', ...docMiddleware, docHandler); - app.get('/:urlId([^/]{12,})(/:slug([^/]+):remainder(*))?', + app.get('/:urlId([^-/]{12,})(/:slug([^/]+):remainder(*))?', ...docMiddleware, docHandler); }