Skip to content

Commit 5ace0cb

Browse files
committed
Allow other type of trace ID token for files routes
1 parent 07f4777 commit 5ace0cb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/routes/admin/files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ router.get('/:id', requireAdmin, validateParams(getSchema), async (req: express.
2727

2828
const listSchema = Joi.object({
2929
ids: Joi.array().items(Joi.string().guid({ version: 'uuidv4' })).required(),
30-
traceId: Joi.string().guid().optional(),
30+
traceId: Joi.alternatives().try(Joi.string().guid(), Joi.string().pattern(/^[0-9a-z-]+$/)).optional(),
3131
});
3232

3333
router.get('/', requireAdmin, validateQuery(listSchema), async (req: express.Request, res: express.Response, next: express.NextFunction) => {

src/routes/files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ router.get('/:id', requireAuth, validateParams(getSchema), async (req: express.R
2727

2828
const listSchema = Joi.object({
2929
ids: Joi.array().items(Joi.string().guid({ version: 'uuidv4' }).required()).required(),
30-
traceId: Joi.string().guid().optional(),
30+
traceId: Joi.alternatives().try(Joi.string().guid(), Joi.string().pattern(/^[0-9a-z-]+$/)).optional(),
3131
});
3232

3333
router.get('/', requireAuth, validateQuery(listSchema), async (req: express.Request, res: express.Response, next: express.NextFunction) => {

0 commit comments

Comments
 (0)