From 90a52f57b5304be5129a9ea6d2cb245a6022b86c Mon Sep 17 00:00:00 2001 From: azivner Date: Sun, 9 Dec 2018 14:30:19 +0100 Subject: [PATCH] recent notes route accepts slash in the param (problem with nginx etc.) --- src/routes/routes.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/routes.js b/src/routes/routes.js index 01d4dbcd5..93b7314e5 100644 --- a/src/routes/routes.js +++ b/src/routes/routes.js @@ -169,7 +169,9 @@ function register(app) { apiRoute(GET, '/api/event-log', eventLogRoute.getEventLog); - apiRoute(PUT, '/api/recent-notes/:branchId/:notePath', recentNotesRoute.addRecentNote); + // * at the end means this will match params containing slash as well + // this is a problem with nginx (and possibly other proxies) which translate escaped slash back to the literal slash character + apiRoute(PUT, '/api/recent-notes/:branchId/:notePath*', recentNotesRoute.addRecentNote); apiRoute(GET, '/api/app-info', appInfoRoute.getAppInfo); route(GET, '/api/setup/status', [], setupApiRoute.getStatus, apiResultHandler);