Skip to content

Commit 5b01842

Browse files
committed
fix(amplify-storage-simulator): fixes aws-amplify#3215 Invalid win chars
1 parent ddc73ff commit 5b01842

File tree

1 file changed

+5
-0
lines changed
  • packages/amplify-storage-simulator/src/server

1 file changed

+5
-0
lines changed

packages/amplify-storage-simulator/src/server/utils.ts

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export function parseUrl(request, route: String) {
1717
request.params.path = request.params.path.substring(1);
1818
}
1919

20+
// changing file path by removing invalid file path characters for windows
21+
if (process.platform === 'win32') {
22+
request.params.path = request.params.path.replace(/[<>:"|?*]/g, (match, capture) => '%' + Buffer.from(match, 'utf8').toString('hex'));
23+
}
24+
2025
if (request.method === 'GET') {
2126
if (request.query.prefix !== undefined || (temp[1] === '' && temp[0] === '')) {
2227
request.method = 'LIST';

0 commit comments

Comments
 (0)