summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOleg Morozenkov <reo7sp@users.noreply.github.com>2017-01-15 02:01:22 +0300
committerOleg Morozenkov <reo7sp@users.noreply.github.com>2017-01-15 02:01:22 +0300
commitad676623168e7b7b083f66617087c6cf424000d1 (patch)
tree64a893a0c17e2a29c227ebdb53076e40ace19af0 /src
parentbbf030e1d315d6ba108a75a5ce0113485a2319ba (diff)
Fix tests
Diffstat (limited to 'src')
-rw-r--r--src/net/HttpParser.cpp2
-rw-r--r--src/net/Url.cpp5
-rw-r--r--src/tools/StringTools.cpp2
3 files changed, 3 insertions, 6 deletions
diff --git a/src/net/HttpParser.cpp b/src/net/HttpParser.cpp
index 4b57bc1..befbc3b 100644
--- a/src/net/HttpParser.cpp
+++ b/src/net/HttpParser.cpp
@@ -99,7 +99,7 @@ string HttpParser::generateMultipartFormData(const vector<HttpReqArg>& args, con
result += item.value;
result += "\r\n";
}
- result += "--" + bondary + "--";
+ result += "--" + bondary + "--\r\n";
return result;
}
diff --git a/src/net/Url.cpp b/src/net/Url.cpp
index 44d9089..005506c 100644
--- a/src/net/Url.cpp
+++ b/src/net/Url.cpp
@@ -75,11 +75,6 @@ Url::Url(const string& url) {
fragment += c;
}
}
-
- host = StringTools::urlEncode(host, ".");
- path = StringTools::urlEncode(path, "/");
- query = StringTools::urlEncode(query, "&");
- fragment = StringTools::urlEncode(fragment);
}
}
diff --git a/src/tools/StringTools.cpp b/src/tools/StringTools.cpp
index d5270db..a48b4eb 100644
--- a/src/tools/StringTools.cpp
+++ b/src/tools/StringTools.cpp
@@ -56,6 +56,8 @@ bool endsWith(const string& str1, const string& str2) {
string::const_iterator begin1(str1.begin());
string::const_iterator it2(str2.end());
string::const_iterator begin2(str2.begin());
+ --begin1;
+ --begin2;
while (it1 != begin1 && it2 != begin2) {
if (*it1 != *it2) {
return false;