More whitespace fixes.

This commit is contained in:
James Turner
2015-11-22 23:53:46 +00:00
parent 5c9ca9cbe2
commit 23b8c86e78
2 changed files with 9 additions and 9 deletions
+8 -8
View File
@@ -207,7 +207,7 @@ std::string Request::scheme() const
if (firstColon > 0) { if (firstColon > 0) {
return url().substr(0, firstColon); return url().substr(0, firstColon);
} }
return ""; // couldn't parse scheme return ""; // couldn't parse scheme
} }
@@ -219,20 +219,20 @@ std::string Request::path() const
if (schemeEnd < 0) { if (schemeEnd < 0) {
return ""; // couldn't parse scheme return ""; // couldn't parse scheme
} }
int hostEnd = u.find('/', schemeEnd + 3); int hostEnd = u.find('/', schemeEnd + 3);
if (hostEnd < 0) { if (hostEnd < 0) {
// couldn't parse host, or URL looks like 'http://foo.com' (no trailing '/') // couldn't parse host, or URL looks like 'http://foo.com' (no trailing '/')
// fixup to root resource path: '/' // fixup to root resource path: '/'
return "/"; return "/";
} }
int query = u.find('?', hostEnd + 1); int query = u.find('?', hostEnd + 1);
if (query < 0) { if (query < 0) {
// all remainder of URL is path // all remainder of URL is path
return u.substr(hostEnd); return u.substr(hostEnd);
} }
return u.substr(hostEnd, query - hostEnd); return u.substr(hostEnd, query - hostEnd);
} }
@@ -244,7 +244,7 @@ std::string Request::query() const
if (query < 0) { if (query < 0) {
return ""; //no query string found return ""; //no query string found
} }
return u.substr(query); //includes question mark return u.substr(query); //includes question mark
} }
+1 -1
View File
@@ -46,7 +46,7 @@ char body2[body2Size];
cerr << "failed:" << #a << endl; \ cerr << "failed:" << #a << endl; \
exit(1); \ exit(1); \
} }
class TestRequest : public HTTP::Request class TestRequest : public HTTP::Request
{ {
public: public: