mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-18 21:45:12 +00:00
@@ -33,8 +33,8 @@ export default function create_routes({ files } = { files: glob.sync('**/*.+(htm
|
|||||||
let i = parts.length;
|
let i = parts.length;
|
||||||
let nested = true;
|
let nested = true;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
const part = parts[i];
|
const part = encodeURIComponent(parts[i].normalize()).replace(/%5B/g, '[').replace(/%5D/g, ']');
|
||||||
const dynamic = part[0] === '[';
|
const dynamic = ~part.indexOf('[');
|
||||||
|
|
||||||
if (dynamic) {
|
if (dynamic) {
|
||||||
const matcher = part.replace(param_pattern, `([^\/]+?)`);
|
const matcher = part.replace(param_pattern, `([^\/]+?)`);
|
||||||
|
|||||||
1
test/app/routes/fünke.html
Normal file
1
test/app/routes/fünke.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h1>I'm afraid I just blue myself</h1>
|
||||||
@@ -403,6 +403,14 @@ function run(env) {
|
|||||||
assert.equal(text, 'nope');
|
assert.equal(text, 'nope');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('encodes routes', () => {
|
||||||
|
return nightmare.goto(`${base}/fünke`)
|
||||||
|
.page.title()
|
||||||
|
.then(title => {
|
||||||
|
assert.equal(title, `I'm afraid I just blue myself`);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('headers', () => {
|
describe('headers', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user