Merge pull request #234 from akihikodaki/master

Do not encode characters allowed in path when generating routes
This commit is contained in:
Rich Harris
2018-05-03 21:37:59 -04:00
committed by GitHub
2 changed files with 20 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ export default function create_routes({ files } = { files: glob.sync('**/*.*', {
let i = parts.length;
let nested = true;
while (i--) {
const part = encodeURIComponent(parts[i].normalize()).replace(/%5B/g, '[').replace(/%5D/g, ']');
const part = encodeURI(parts[i].normalize()).replace(/\?/g, '%3F').replace(/#/g, '%23').replace(/%5B/g, '[').replace(/%5D/g, ']');
const dynamic = ~part.indexOf('[');
if (dynamic) {