Просмотр исходного кода

handle options request for all axios versions

Futa Arai 7 месяцев назад
Родитель
Сommit
db5ee6a90a
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      packages/remark-attachment-refs/src/server/routes/refs.ts

+ 3 - 1
packages/remark-attachment-refs/src/server/routes/refs.ts

@@ -180,7 +180,9 @@ export const routesFactory = (crowi): any => {
       const user = req.user;
       const { prefix, pagePath } = req.query;
       const options: Record<string, string | undefined> =
-        req.query.options ?? {};
+        typeof req.query.options === 'string'
+          ? JSON.parse(req.query.options)
+          : (req.query.options ?? {});
 
       // check either 'prefix' or 'pagePath ' is specified
       if (prefix == null && pagePath == null) {