filter spaces in the url

It seems spaces are not urlencoded once it is proxied by cURL, this might not fix the underlying problem, but it worked well for me, without regressions.