decode req.path during export

This commit is contained in:
Rich Harris
2018-09-03 09:02:13 -04:00
parent 499b377bfd
commit 0706b5f50a
3 changed files with 11 additions and 1 deletions

View File

@@ -85,7 +85,7 @@ async function execute(emitter: EventEmitter, opts: Opts) {
function save(path: string, status: number, type: string, body: string) { function save(path: string, status: number, type: string, body: string) {
const { pathname } = resolve(origin, path); const { pathname } = resolve(origin, path);
let file = pathname.slice(1); let file = decodeURIComponent(pathname.slice(1));
if (saved.has(file)) return; if (saved.has(file)) return;
saved.add(file); saved.add(file);

View File

@@ -106,6 +106,14 @@ const posts = [
<p>If you didn't have adult onset diabetes, I wouldn't mind giving you a little sugar. Everybody dance NOW. And the soup of the day is bread. Great, now I'm gonna smell to high heaven like a tuna melt!</p> <p>If you didn't have adult onset diabetes, I wouldn't mind giving you a little sugar. Everybody dance NOW. And the soup of the day is bread. Great, now I'm gonna smell to high heaven like a tuna melt!</p>
<p>That's how Tony Wonder lost a nut. She calls it a Mayonegg. Go ahead, touch the Cornballer. There's a new daddy in town. A discipline daddy.</p> <p>That's how Tony Wonder lost a nut. She calls it a Mayonegg. Go ahead, touch the Cornballer. There's a new daddy in town. A discipline daddy.</p>
` `
},
{
title: 'Encödïng test',
slug: 'encödïng-test',
html: `
<p>It works</p>
`
} }
]; ];

View File

@@ -93,6 +93,7 @@ function testExport({ basepath = '' }) {
'blog/how-to-use-sapper/index.html', 'blog/how-to-use-sapper/index.html',
'blog/what-is-sapper/index.html', 'blog/what-is-sapper/index.html',
'blog/why-the-name/index.html', 'blog/why-the-name/index.html',
'blog/encödïng-test/index.html',
'blog.json', 'blog.json',
'blog/a-very-long-post.json', 'blog/a-very-long-post.json',
@@ -101,6 +102,7 @@ function testExport({ basepath = '' }) {
'blog/how-to-use-sapper.json', 'blog/how-to-use-sapper.json',
'blog/what-is-sapper.json', 'blog/what-is-sapper.json',
'blog/why-the-name.json', 'blog/why-the-name.json',
'blog/encödïng-test.json',
'favicon.png', 'favicon.png',
'global.css', 'global.css',