From dd8a2187da138ccdb5c8af966af214c3ce529e6c Mon Sep 17 00:00:00 2001 From: Cloud Date: Thu, 19 Sep 2019 23:48:00 +0800 Subject: [PATCH] fix: github trending url URLencode (#3115) --- lib/routes/github/trending.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/github/trending.js b/lib/routes/github/trending.js index 43f187d7a..90f31def2 100644 --- a/lib/routes/github/trending.js +++ b/lib/routes/github/trending.js @@ -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',