-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot download file with non-ascii filename from remote source #35636
Comments
Workaround to [WMAS-46] See also gatsbyjs/gatsby#35636
change const fileDownloadPromise = pushTask({
url,
cache,
createNode,
parentNodeId,
createNodeId,
auth,
httpHeaders,
ext,
name: decodeURI(name), // << HERE
limit
}); will fix the problem. |
Ah... sorry... I had same issue while using wordpress, so I modified like that. Is it from helmet? or so? find similar path may fix it I think. const filename = await fetchRemoteFile({
url,
cache,
auth,
httpHeaders,
ext,
name: decodeURI(name), // << HERE
}) |
To get rid of the more fundamental problem const downloadPath = createFilePath(finalDirectory, decodeURI(name), ext) By the way, |
@cometkim Well, this approach is opposite to my first approach, if there's 'name' param, getRemoteFileName won't be called. |
Ok I see, that a good catch. |
See gatsbyjs/gatsby#35636 Resolves [WMAS-46]
* [WMAS-46] remove temporal patch code for file downloading See gatsbyjs/gatsby#35636 Resolves [WMAS-46] * update lockfile
Preliminary Checks
Description
when I source file nodes via
createRemoteFileNode
.The actual saved filename should be a decoded string. otherwise it becomes unavailable if source url is an encoded string.
For example, sourcing a file from
a340d817-7e76-4dfd-a704-74b4a526d77c_테스트.txt
, itspublicURL
and actual base on the filesystem is going to bea340d817-7e76-4dfd-a704-74b4a526d77c_%e1%84%90%e1%85%a6%e1%84%89%e1%85%b3%e1%84%90%e1%85%b3.txt
I think publicURL is fine, but filesystem path with encoded base is not useful because typical web servers cannot retrieve it from the publicURL.
Reproduction Link
https://github.com/cometkim/gatsby-remote-file-non-ascii
Steps to Reproduce
yarn install
& start gatsbyExpected Result
200 Ok, I can see the text content
"테스트"
Actual Result
404 Not found.
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: