Skip to content

Commit

Permalink
fix(gatsby-core-utils): decode uri-encode filename for remote file
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim committed May 12, 2022
1 parent 35d4a92 commit 51fcbbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-core-utils/src/filename-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function getRemoteFileExtension(url: string): string {
*
*/
export function getRemoteFileName(url: string): string {
return getParsedPath(url).name
return decodeURIComponent(getParsedPath(url).name)
}

export function createFileHash(input: string, length: number = 8): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-source-filesystem/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function getRemoteFileExtension(url) {
* @return {String} filename
*/
export function getRemoteFileName(url) {
return getParsedPath(url).name
return decodeURIComponent(getParsedPath(url).name)
}

// createFilePath should be imported from `gatsby-core-utils`
Expand Down

0 comments on commit 51fcbbb

Please sign in to comment.