Unverified Commit 2772ff99 authored by Dennis Jenkins's avatar Dennis Jenkins Committed by GitHub

Merge pull request #367 from knowledge4igor/code_improvements_9

Tiny code improvements
parents ca1e564e a6050ba8
......@@ -253,7 +253,7 @@ public:
return end() - start();
}
std::string text() {
std::string text() const {
return std::string(gptr, size());
}
......
......@@ -79,18 +79,18 @@ namespace {
void writeCookies(std::stringstream& streamBuf, const Http::CookieJar& cookies) {
using Http::crlf;
std::vector<std::pair<std::string, std::string>> cookiesInfo;
for (const auto& cookie: cookies) {
cookiesInfo.emplace_back(cookie.name, cookie.value);
}
streamBuf << "Cookie: ";
for (size_t i = 0; i < cookiesInfo.size(); ++i) {
if (i > 0) {
bool first = true;
for (const auto& cookie: cookies) {
if (!first) {
streamBuf << "; ";
}
streamBuf << cookiesInfo[i].first << "=" << cookiesInfo[i].second;
else {
first = false;
}
streamBuf << cookie.name << "=" << cookie.value;
}
streamBuf << crlf;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment