Skip to content
Snippets Groups Projects
Commit 769960f2 authored by MeiMei's avatar MeiMei Committed by syuilo
Browse files

Encode fetch URI if needed (#2649)

parent d92e9759
No related branches found
No related tags found
No related merge requests found
......@@ -34,8 +34,9 @@ export default async (url: string, user: IUser, folderId: mongodb.ObjectID = nul
// write content at URL to temp file
await new Promise((res, rej) => {
const writable = fs.createWriteStream(path);
const requestUrl = URL.parse(url).pathname.match(/[^\u0021-\u00ff]/) ? encodeURI(url) : url;
request({
url,
url: requestUrl,
headers: {
'User-Agent': config.user_agent
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment