mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
@@ -33,8 +33,8 @@ export default function create_routes({ files } = { files: glob.sync('**/*.+(htm
|
||||
let i = parts.length;
|
||||
let nested = true;
|
||||
while (i--) {
|
||||
const part = parts[i];
|
||||
const dynamic = part[0] === '[';
|
||||
const part = encodeURIComponent(parts[i].normalize()).replace(/%5B/g, '[').replace(/%5D/g, ']');
|
||||
const dynamic = ~part.indexOf('[');
|
||||
|
||||
if (dynamic) {
|
||||
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');
|
||||
});
|
||||
});
|
||||
|
||||
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', () => {
|
||||
|
||||
Reference in New Issue
Block a user