fix: github trending url URLencode (#3115)

This commit is contained in:
Cloud
2019-09-19 23:48:00 +08:00
committed by DIYgod
parent 64740b812e
commit dd8a2187da

View File

@@ -4,7 +4,7 @@ const cheerio = require('cheerio');
module.exports = async (ctx) => {
const since = ctx.params.since;
const language = ctx.params.language || '';
const url = `https://github.com/trending/${language}?since=${since}`;
const url = `https://github.com/trending/${encodeURIComponent(language)}?since=${since}`;
const response = await got({
method: 'get',