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

Commit

Permalink
Merge pull request #414 from sveltejs/gh-347-b
Browse files Browse the repository at this point in the history
decode req.path during export
  • Loading branch information
Rich-Harris authored Sep 4, 2018
2 parents 499b377 + 0706b5f commit 17297a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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

0 comments on commit 17297a9

Please sign in to comment.