Skip to content

Commit c2b1f3d

Browse files
committed
fix(assets, serverless-api): uri encode path names for asset versions
1 parent 19130d0 commit c2b1f3d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/plugin-assets/src/upload.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async function upload({
101101
} catch (error) {
102102
handleError(`Could not read ${filePath}`, error);
103103
}
104-
const path = `/${basename(filePath)}`;
104+
const path = `${basename(filePath)}`;
105105
const newAsset = {
106106
name: path,
107107
access: 'public',

packages/serverless-api/src/api/assets.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export async function createAssetVersion(
142142
};
143143

144144
const form = new FormData();
145-
form.append('Path', asset.path);
145+
form.append('Path', encodeURIComponent(asset.path));
146146
form.append('Visibility', asset.access);
147147
form.append('Content', asset.content, contentOpts);
148148

0 commit comments

Comments
 (0)