mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-04 02:58:08 +08:00
feat: move encodeURIComponent to routes
This commit is contained in:
@@ -38,15 +38,6 @@ const custom = got.extend({
|
||||
options.query = options.query || queryString.stringify(options.params);
|
||||
}
|
||||
if (options.query) {
|
||||
if (typeof options.query === 'string') {
|
||||
options.query = options.query.replace(/([\u4e00-\u9fa5])/g, (str) => encodeURIComponent(str));
|
||||
} else if (typeof options.query === 'object') {
|
||||
for (const key in options.query) {
|
||||
if (typeof options.query[key] === 'string') {
|
||||
options.query[key] = options.query[key].replace(/([\u4e00-\u9fa5])/g, (str) => encodeURIComponent(str));
|
||||
}
|
||||
}
|
||||
}
|
||||
options.searchParams = options.query; // for Got v11 after
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user