Skip to content

Commit

Permalink
page: encode title in pageViews() request
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed May 16, 2021
1 parent 640fbe3 commit ec1f782
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,22 @@ export default function (bot: mwn): MwnPageStatic {

return bot
.rawRequest({
url: `https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/${project}/${access}/${agent}/${this.toString()}/${granularity}/${startString}/${endString}`,
url:
'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article' +
'/' +
project +
'/' +
access +
'/' +
agent +
'/' +
encodeURIComponent(this.toString()) +
'/' +
granularity +
'/' +
startString +
'/' +
endString,
headers: {
'User-Agent': bot.options.userAgent,
},
Expand Down

0 comments on commit ec1f782

Please sign in to comment.