ContentMine / getpapers

Get metadata, fulltexts or fulltext URLs of papers matching a search query

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getpapers should not urlencode '&', '=', or '?' in its query URLs

sedimentation-fault opened this issue · comments

Problem

In getpapers/lib/arxiv.js we see:

var queryurl = arxiv.baseurl + encodeURIComponent(query)

Using encodeURIComponent is overkill here, it will 'urlencode' all characters of query, including '&', '?' and others. According to my understanding of the HTTP protocol, this is even plain wrong.

Solution

Use encodeURI instead:

var queryurl = arxiv.baseurl + encodeURI(query)