Skip to content

Commit

Permalink
fix: remove consecutive slashes
Browse files Browse the repository at this point in the history
A small middleware who will rewrite potential dual slashes to a single slash.
  • Loading branch information
ivarconr committed Jun 5, 2023
1 parent 821664f commit e468af6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/app.ts
Expand Up @@ -64,6 +64,11 @@ export default async function getApp(
app.use(compression());
app.use(cookieParser());

app.use((req, res, next) => {
req.url = req.url.replace(/\/+/g, '/');
next();
});

app.use(
`${baseUriPath}/api/admin/features-batch`,
express.json({ strict: false, limit: '500kB' }),
Expand Down

0 comments on commit e468af6

Please sign in to comment.