}
int hostEnd = u.find('/', schemeEnd + 3);
- if (hostEnd < 0) {
- return ""; // couldn't parse host
+ if (hostEnd < 0) {
+// couldn't parse host, or URL looks like 'http://foo.com' (no trailing '/')
+// fixup to root resource path: '/'
+ return "/";
}
int query = u.find('?', hostEnd + 1);
void Request::failed()
{
// no-op in base class
+ SG_LOG(SG_IO, SG_INFO, "request failed:" << url());
}
Request::HTTPVersion Request::decodeVersion(const string& v)
// for non HTTP/1.1 connections, assume server closes
return _willClose || (_responseVersion != HTTP_1_1);
}
+
+int Request::requestBodyLength() const
+{
+ return -1;
+}
+
+std::string Request::requestBodyType() const
+{
+ return "text/plain";
+}
+
+void Request::getBodyData(char*, int& count) const
+{
+ count = 0;
+ return;
+}
} // of namespace HTTP