Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

decode req.path during export #414

Merged
merged 1 commit into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function execute(emitter: EventEmitter, opts: Opts) {

function save(path: string, status: number, type: string, body: string) {
const { pathname } = resolve(origin, path);
let file = pathname.slice(1);
let file = decodeURIComponent(pathname.slice(1));

if (saved.has(file)) return;
saved.add(file);
Expand Down
8 changes: 8 additions & 0 deletions test/app/routes/blog/_posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>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>
`
}
];

Expand Down
2 changes: 2 additions & 0 deletions test/common/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function testExport({ basepath = '' }) {
'blog/how-to-use-sapper/index.html',
'blog/what-is-sapper/index.html',
'blog/why-the-name/index.html',
'blog/encödïng-test/index.html',

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

'favicon.png',
'global.css',
Expand Down