Skip to content

Commit

Permalink
fix: encode tails url (#1479)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleach authored Jun 7, 2023
1 parent bd3bc59 commit fd190b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-native/src/ReactNativeFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ export class ReactNativeFileSystem implements FileSystem {
// Make sure parent directories exist
await RNFS.mkdir(getDirFromFilePath(path))

// Some characters in the URL might be invalid for
// the native os to handle. We need to encode the URL.
const encodedFromUrl = encodeURI(url)
const { promise } = RNFS.downloadFile({
fromUrl: url,
fromUrl: encodedFromUrl,
toFile: path,
})

Expand Down

0 comments on commit fd190b9

Please sign in to comment.