Request::from_url was incorrectly creating requests with unencoded URLs.
Request::Request(const string &m, const string &p):
method(m),
path(p)
-{ }
+{
+ if(path.find(' ')!=string::npos)
+ throw invalid_argument("Request::Request");
+}
string Request::str() const
{
if(url.scheme!="http")
throw invalid_argument("Request::from_url");
- string path = url.path;
+ string path = urlencode(url.path);
if(path.empty())
path = "/";
if(!url.query.empty())