From 88d9858da9907a7301a3f676ba1c3fb3fa3afc38 Mon Sep 17 00:00:00 2001 From: Antonio Date: Fri, 17 Dec 2021 08:20:43 +0100 Subject: [PATCH] fix: replace named request param to wildcard matcher (#21) --- src/consts.js | 2 +- src/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/consts.js b/src/consts.js index 0433727..ed56331 100644 --- a/src/consts.js +++ b/src/consts.js @@ -6,7 +6,7 @@ */ // did -const URI_DID = '/1.0/identifiers/:did' +const URI_DID = '/1.0/identifiers/*' module.exports = { URI_DID diff --git a/src/index.js b/src/index.js index 0af4d00..1b029d9 100644 --- a/src/index.js +++ b/src/index.js @@ -27,7 +27,8 @@ async function start() { console.info('\n→ Received headers:') console.info(JSON.stringify(req.headers, null, 2)) const { exportType, defaultExport, responseContentType } = processAcceptHeaders(req.headers.accept) - const { did } = req.params + // We can't use pattern matching as the DID might include '/' characters. + const did = req.params['0'] // Add queried DID to default export for deleted resolutions defaultExport.id = did