mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 12:21:31 +08:00
fix: Request path contains unescaped characters error (#2784)
This commit is contained in:
@@ -80,9 +80,11 @@ const custom = got.extend({
|
||||
}
|
||||
if (options.params) {
|
||||
options.query = options.query || queryString.stringify(options.params);
|
||||
}
|
||||
if (options.query) {
|
||||
options.query = options.query.replace(/([\u4e00-\u9fa5])/g, (str) => encodeURIComponent(str));
|
||||
options.searchParams = options.query; // for Got v11 after
|
||||
}
|
||||
|
||||
if (agent && new RegExp(config.proxy.url_regex).test(options.href)) {
|
||||
options.agent = agent[options.protocol.slice(0, -1)];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user